[CDRIVER-333] Unable to compile C driver in Solaris Created: 03/Apr/14  Updated: 11/Sep/19  Resolved: 16/Apr/14

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 0.8.1
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jyothi Kommajosyula Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris


Issue Links:
Related

 Description   

Trying to build the driver in Solaris using make and gcc.

During the ‘make’ step, we are facing issues with the underlying C driver components and we are getting errors like the below.

sun4-cross: make -f Makefile.am
make: Fatal error in reader: Makefile.am, line 11: Unexpected end of line seen



 Comments   
Comment by Christian Hergert [ 16/Apr/14 ]

mongo-c-driver 0.94.2 supports Solaris 10 SPARC using both the SunStudio compiler and GCC.

We have pre-built binaries available (although without SSL or Kerberos support) on the releases page which can be found at https://github.com/mongodb/mongo-c-driver/releases/tag/0.94.2

If you have any issues compiling, don't hesitate to re-open this with output from ./configure or make.

Comment by Edouard Servan-Schreiber [ 16/Apr/14 ]

sounds fair to me.
-edss

Comment by Jyothi Kommajosyula [ 04/Apr/14 ]

GCC is not available in Solaris env, checking for ways to get GCC installed

Comment by Edouard Servan-Schreiber [ 04/Apr/14 ]

Description of environment from email:
FYI:-

bash-3.2$ cat /etc/release

Solaris 10 10/08 s10s_u6wos_07b SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 27 October 2008

bash-3.2$ uname –a

SunOS cpbswpoue1 5.10 Generic_150400-02 sun4u sparc SUNW,Sun-Fire-V490

Comment by Richard Kreuter (Inactive) [ 04/Apr/14 ]

Hi Jyothi,

I am not very expert at modern Solaris, but I believe something like the following ought to suffice to get you a recent version of GCC:

pkg install gcc-45

Of course there might be permissions prerequisites on your system. What version of Solaris are you using?

Regards,
Richard

Comment by Jyothi Kommajosyula [ 04/Apr/14 ]

Thanks Richard. I was using source files earlier, now I took the .tar version.

Now it builds fine, but I have some gcc issue on my Solaris machine, trying to get gcc now. Thanks for your help.

sun4-cross: ./configure
checking for gcc... /xenv/Forte/sun4/12.0/5.10u1/prod/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /xenv/Forte/sun4/12.0/5.10u1/prod/bin/cc accepts -g... yes
checking for /xenv/Forte/sun4/12.0/5.10u1/prod/bin/cc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... CC
checking whether we are using the GNU C++ compiler... no
checking whether CC accepts -g... yes
configure: error: Compiler GCC >= 4.1 or Clang >= 3.3 is required for C compilation

Regards
Jyothi

Comment by Richard Kreuter (Inactive) [ 04/Apr/14 ]

Hi Jyothi,

Are you getting the official release tar file, or cloning from github?

The git repositories do not include the configure script, but rather the configure.ac file, which is an input to the "autotools" suite (the Makefile.am file you tried to use yesterday is another input to autotools).

Please obtain the release tar file from here:

https://github.com/mongodb/mongo-c-driver/releases

and try the following steps:

./configure
make
make install

Regards,
Richard

Comment by Jyothi Kommajosyula [ 04/Apr/14 ]

Hi Richard

I tried the below steps, but I get a different error

sun4-cross: pwd
/apps/enterprise-docs/weblogic/10.3/user_projects/osdevbDomain/mongodb_poc/mongo-c-driver-0.92.2-I
sun4-cross: ls
CMakeLists.txt COPYING NEWS autogen.sh configure.ac examples tests
CONTRIBUTING.md Makefile.am README.rst build doc src
sun4-cross: ./configure.ac
./configure.ac: syntax error at line 1: `AC_PREREQ' unexpected

Regards
Jyothi

Comment by Richard Kreuter (Inactive) [ 03/Apr/14 ]

Hi Jyothi,

It looks like you're running "make" on a file that isn't a Makefile, but rather an input to the "automake" component of the "autotools" suite. It also seems you're trying an old version of the driver; the latest release is 0.92.2, available here:

https://github.com/mongodb/mongo-c-driver/releases

The releases follow the convention of including a "configure" script that generates a Makefile, so the build instructions should be as simple as

$ ./configure
$ make
$ make install

Please let us know if you find these steps don't work out.

Regards,
Richard

Generated at Wed Feb 07 21:09:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.