Problems when compiling the source code

Bug/problem reports for any of the GYRE executables (gyre_ad, gyre_nad, etc)
Post Reply
han190
Posts: 3
Joined: Sun Apr 20, 2014 11:34 pm

Problems when compiling the source code

Post by han190 » Mon Apr 21, 2014 9:32 am

Hi, all
When I try to install and compile the gyre code I meet the following problem:

hans-MacBook-Pro-245:gyre han190$ make
make[1]: Entering directory `/Users/han190/mesa/gyre/gyre/src'
make[2]: Entering directory `/Users/han190/mesa/gyre/gyre/src/ad'
FC gyre_ad.f90
Warning: Nonexistent include directory "/include"
LD gyre_ad
/bin/sh: mesasdk_hdf5_link: command not found
/bin/sh: mesasdk_lapack95_link: command not found
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [gyre_ad] Error 1
rm gyre_ad.o
make[2]: Leaving directory `/Users/han190/mesa/gyre/gyre/src/ad'
make[1]: Leaving directory `/Users/han190/mesa/gyre/gyre/src'

I suppose to type in "cd $GYRE_DIR" and "make" but it does not work for my laptop. Btw I am using gfortran 4.9.0. Anyone has any idea about it? Thanks.

Han

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: Problems when compiling the source code

Post by rhtownsend » Mon Apr 21, 2014 9:35 am

han190 wrote:Hi, all
When I try to install and compile the gyre code I meet the following problem:

hans-MacBook-Pro-245:gyre han190$ make
make[1]: Entering directory `/Users/han190/mesa/gyre/gyre/src'
make[2]: Entering directory `/Users/han190/mesa/gyre/gyre/src/ad'
FC gyre_ad.f90
Warning: Nonexistent include directory "/include"
LD gyre_ad
/bin/sh: mesasdk_hdf5_link: command not found
/bin/sh: mesasdk_lapack95_link: command not found
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [gyre_ad] Error 1
rm gyre_ad.o
make[2]: Leaving directory `/Users/han190/mesa/gyre/gyre/src/ad'
make[1]: Leaving directory `/Users/han190/mesa/gyre/gyre/src'

I suppose to type in "cd $GYRE_DIR" and "make" but it does not work for my laptop. Btw I am using gfortran 4.9.0. Anyone has any idea about it? Thanks.

Han
Hi Han --

It looks like you haven't installed (or properly initialized) the MESA SDK:

http://www.astro.wisc.edu/~townsend/sta ... ef=mesasdk

cheers,

Rich

han190
Posts: 3
Joined: Sun Apr 20, 2014 11:34 pm

Re: Problems when compiling the source code

Post by han190 » Mon Apr 21, 2014 10:19 am

Thanks! Sorry I have to bother you again :(
But I believe I installed the MESA SDK (probably not properly), because I use MESA and MESA works well on my macbook.
I reinstalled MESA SDK. The problem is still there with few sentences less.

hans-MacBook-Pro-245:gyre han190$ make
make[1]: Entering directory `/Users/han190/mesa/gyre/gyre/src'
make[2]: Entering directory `/Users/han190/mesa/gyre/gyre/src/ad'
FC gyre_ad.f90
LD gyre_ad
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [gyre_ad] Error 1
rm gyre_ad.o
make[2]: Leaving directory `/Users/han190/mesa/gyre/gyre/src/ad'
make[1]: Leaving directory `/Users/han190/mesa/gyre/gyre/src'

Here is the troubleshooting I did following the website you give:
hans-MacBook-Pro-245:gyre han190$ echo $PATH
/Applications/mesasdk/bin:/Users/han190/Library/Enthought/Canopy_64bit/User/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin

hans-MacBook-Pro-245:gyre han190$ echo $MESASDK_ROOT
/Applications/mesasdk

hans-MacBook-Pro-245:gyre han190$ gfortran -v
Using built-in specs.
COLLECT_GCC=/Applications/mesasdk/bin/gfortran.exec
COLLECT_LTO_WRAPPER=/Applications/mesasdk/libexec/gcc/x86_64-apple-darwin11.4.2/4.9.0/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ./configure CC='gcc -D_FORTIFY_SOURCE=0' --build=x86_64-apple-darwin11.4.2 --prefix=/Applications/mesasdk --with-gmp=/Applications/mesasdk --with-mpfr=/Applications/mesasdk --with-mpc=/Applications/mesasdk --enable-languages=c,c++,fortran --disable-multilib --disable-nls --disable-libsanitizer
Thread model: posix
gcc version 4.9.0 20140201 (experimental) (GCC)

hans-MacBook-Pro-245:gyre han190$ uname -a
Darwin hans-MacBook-Pro-245.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: Problems when compiling the source code

Post by rhtownsend » Mon Apr 21, 2014 10:22 am

Hi Han --

Can you try doing 'make clean', and then running 'make' again?

cheers,

Rich

han190
Posts: 3
Joined: Sun Apr 20, 2014 11:34 pm

Re: Problems when compiling the source code

Post by han190 » Mon Apr 21, 2014 10:29 am

It works. Thank you Rich!
So is it because there are still some leftover by my previous operations even if I re-install MESA SDK? I am just curious:)

Han

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: Problems when compiling the source code

Post by rhtownsend » Mon Apr 21, 2014 10:36 am

han190 wrote:It works. Thank you Rich!
So is it because there are still some leftover by my previous operations even if I re-install MESA SDK? I am just curious:)

Han
Yes, it seems that the first time you ran 'make' the MESA SDK wasn't properly installed, and the compilation went wrong. After reinstalling the SDK, the 'make clean' is necessary to clean up files left by the failed compilation, which otherwise get in the way.

cheers,

Rich

Post Reply