CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 Installation (https://www.cfd-online.com/Forums/su2-installation/)
-   -   SU2 Installation error (https://www.cfd-online.com/Forums/su2-installation/217127-su2-installation-error.html)

tarun_ May 1, 2019 03:41

SU2 Installation error
 
1 Attachment(s)
Hello everyone

I am trying to install SU2 on Mac as per the instructions on the website.
when i try to compile SU2 by command $make, i am getting the following error :

Undefined symbols for architecture x86_64:
"double abs<double>(std::__1::complex<double> const&)", referenced from:
CHBDriver::ComputeHB_Operator() in libSU2Core.a(libSU2Core_a-driver_structure.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../bin/SU2_CFD] Error 1
make: *** [all-recursive] Error 1

Please see attached screenshot for details.

Attachment 69719

saladbowl June 11, 2019 07:24

Same problem
 
Hi!

I am having the same issue. Did you find a solution?

OS: macOS 10.14.5 (18F132)

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I also tried to compile with home-brew installed gcc using the appropriate compilation flags, --with-gcc=/usr/local/bin/gcc-9 and --with-gcxx=/usr/local/bin/g++-9

$ /usr/local/bin/gcc-9 --version
gcc-9 (Homebrew GCC 9.1.0) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$/usr/local/bin/g++-9 --version
g++-9 (Homebrew GCC 9.1.0) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

hpatel July 26, 2019 19:54

Same Installation Error
 
Quote:

Originally Posted by tarun_ (Post 732367)
Hello everyone

I am trying to install SU2 on Mac as per the instructions on the website.
when i try to compile SU2 by command $make, i am getting the following error :

Undefined symbols for architecture x86_64:
"double abs<double>(std::__1::complex<double> const&)", referenced from:
CHBDriver::ComputeHB_Operator() in libSU2Core.a(libSU2Core_a-driver_structure.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../bin/SU2_CFD] Error 1
make: *** [all-recursive] Error 1

Please see attached screenshot for details.

Attachment 69719

I am getting the exact same error when I try to configure SU2. Is there a known fix for this issue on MacOS?

------------------------------EDIT------------------------------

Tthis command worked for me:
./configure --prefix=/path/to/SU2 --enable-mpi CXXFLAGS="-std=c++11"

hyunko October 20, 2019 07:53

Same error happens for me.
MacOS Catalina.
Have any update for that issue?

b.shuvayan October 25, 2019 05:04

Quote:

Originally Posted by tarun_ (Post 732367)
Hello everyone

I am trying to install SU2 on Mac as per the instructions on the website.
when i try to compile SU2 by command $make, i am getting the following error :

Undefined symbols for architecture x86_64:
"double abs<double>(std::__1::complex<double> const&)", referenced from:
CHBDriver::ComputeHB_Operator() in libSU2Core.a(libSU2Core_a-driver_structure.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../bin/SU2_CFD] Error 1
make: *** [all-recursive] Error 1

Please see attached screenshot for details.

Attachment 69719




I too had similar problem but I have been able to install SU2 6.2 Falcon on MacOS (Mojive). The issue, as evident from your error report, is clearly caused due to the link between clang and g++. Try the following in terminal:

$ g++ --version # this will tell you the version of g++ compiler installed. If not installed, you will need to install that. Homebrew is a good option for that. Once installed, type

$ g++ # this will likely give an error saying 'clang: error: no input files'

You would need to unlink 'clang' from 'g++'. Type the following in the terminal

$ cd usr/local/bin # this will navigate to bin folder. Populate the directory contents with 'ls'

$ ls # You will probably notice that standalone g++ is missing but instead the installed version of g++ (g++-9 in my case) is present. Type the following

$ ln -s g++-9 g++ # assuming you have the last version of g++ -9 compiler, this will create a new g++ folder in the directory. They have been unlinked. type 'ls' in the terminal to confirm and check.

$ ls # Check for the standalone folder named 'g++'. You may need to log-out and then log-in to your system again for the changes to take effect. Try running the SU2 installation again (I presume you use 'bootstrap', 'configure', 'make' and 'make install'). This will install SU2 without the clang error. This was the only way I could get it to work.

agrenke October 26, 2019 21:11

2 Attachment(s)
Thanks for the helpful post Shuvayan. I've tried what you suggested, and but I still get the same error after trying to compile:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../bin/SU2_CFD] Error 1
make: *** [all-recursive] Error 1



Currently running MacOS 10.15 with the following configuration line:

./configure --enable-mpi --with-cc=/usr/local/bin/mpicc --with-cxx=/usr/local/bin/mpicc CXXFLAGS="-O3"

I've attached the complete output in some text files + some screenshots.

When I type "g++", it appears that I have successfully unlinked g++ and clang:

g++: fatal error: no input files
compilation terminated.


However, I'm also wondering if I have to do something similar for gcc, mpicc, or mpicxx, since they all seem to be currently linked to clang.

Really appreciate the help!

rogerlt October 29, 2019 20:30

Any updates for this issue? I have tried the latest clang and clang++ with llvm 9.0.0 version, but not worked.

filo-gor December 3, 2019 04:06

On Mac you need to go to $SU2_HOME/Common/include/ad_structure.hpp and $SU2_HOME/Common/src/ad_structure.cpp comment lines from #ifdef __APPLE__ to #endif

Try to $make clean to remove all other errors.

Finally should work properly :)

talbring December 3, 2019 13:03

Hi guys,

can you open an Issue on github for this ? Then we have can have a look at the problem.

Best,
Tim


All times are GMT -4. The time now is 07:44.