Dear Sir,
When I run the newest revision 492 using the command below, but it run well for linux
/nucnet-tools-code/examples/network/make run_single_zone
I have the probelm and together with many waringings :
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
my boost can run the exampe:https://sourceforge.net/u/mbradle/wiki/BoostCompile/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your post. Are you saying that you were able to download, compile, and run the code on linux but not on a mac? If this is correct, on your mac, could you do
cd nucnet-tools-code/examples/network make run_single_zone &> log
and attach log to your reply? Thanks, and best wishes.
Last edit: Bradley S. Meyer 2016-07-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2024-04-25
Post awaiting moderation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your post. It looks like it may be this issue. Did you do
export NNT_NO_OPENMP=1
make clean
make run_single_zone
That way your compilation won't pass the -fopenmp flag which should then cause the compiler to avoid trying to link to libgomp, which you apparently don't have.
You might also want to upgrade your XCode since the newer versions of clang seem to have settled on the OpenMP library. Let me know if you have further trouble. Best wishes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your post. That's a curious error. Do you have write permission to that directory? Does my_output.xml already exist? You might try
ls -l my_output.xml
If the file exists, you should see
-rw-r--r--
If you don't have write permission (the w), the file can't be written to. If the file doesn't exist, you probably don't have write access to the directory.
You could try changing the name from my_output.xml (say, to my_out.xml) and rerunning, or simply removing my_output.xml by typing
rm my_output.xml
and rerunning. Let me know if you still have trouble. Best wishes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Meyer,
I have tried another way to compile the run_single_zone as you list for us:
unset BOOST_LIB_DIR
export NNT_NO_OPENMP=1
sudo port select --set gcc none
I can now type
make clean
make run_entropy
This successfully compiles the code with clang. To again compile with gcc, I type
unset NNT_NO_OPENMP
export BOOST_LIB_DIR=/Users/bradleymeyer/boost/stage/lib
sudo port select --set gcc mp-gcc5
I now compile by typing
make clean
make run_entropy
It is successfully to make it compiled.
But the after the two ways when I make the command:
./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
the result is still:
Couldn't open file traj.txt!
Another problem is that I can not use the command:
sudo port select --set gcc mp-gcc5
Password:
Sorry, try again.
Password:
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:analysis mumu$ sudo port select --set gcc mp-gcc5
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:analysis mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
superman:analysis mumu$ sudo port select --list gcc
Available versions for gcc:
mp-gcc49
mp-gcc5 (active)
none
superman:analysis mumu$ which gcc
/usr/bin/gcc
It seems gcc is correctly but not be shown the right way as after the command 'gcc -v'
I use this way to set GCC:
export PATH=$PATH:/opt/local/bin/gcc
alias gcc='/opt/local/bin/gcc'
alias g++='/opt/local/bin/g++'
Can you help me manage to make 'sudo port select --set gcc mp-gcc5' really work on my Mac PC?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Not finding the trajectory file. Be sure that you compiled against the right hydro code. If you type
./run_single_zone
you'll get a usage statement. If the usage statment does not ask for a trajectory file, then you've compile against the wrong hydro code. Be sure to supply the trajectory file--it is input.
2) If you use set_gcc and set_clang, as I described, the compiler will be properly set but it might not show the right command with gcc -v. You might need to source ~./bash_profile to show that. In my case, I could fix that by changing the lines in the ~/.bash_profile file to include source .bash_profile: In my case:
##
# set compiler
##
alias set_clang='sudo port select --set gcc none; source ~/.bash_profile; unset BOOST_LIB_DIR; export NNT_NO_OPENMP=1'
alias set_gcc='sudo port select --set gcc mp-gcc5; source ~/.bash_profile; unset NNT_NO_OPENMP; export BOOST_LIB_DIR=/Users/bradleymeyer/boost/stage/lib'
Now I get the right response (after typing source ~/.bash_profile):
set_clang
gcc -v
returns
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
When I set the environments in ~/bash_profile: ##
# set compiler
##
alias set_clang='sudo port select --set gcc none; unset BOOST_LIB_DIR; export \
NNT_NO_OPENMP=1'
alias set_gcc='sudo port select --set gcc mp-gcc5; unset NNT_NO_OPENMP; export\
BOOST_LIB_DIR=/Users/mumu/boost/stage/lib'
1.I tried to set gcc first, but I get
superman:network mumu$ set_gcc
Password:
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:network mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
It seems it does not set correctly and if I run
superman:network mumu$ make run_single_zone
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
2.when I set clang
superman:network mumu$ set_clang
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:network mumu$ echo $BOOST_LIB_DIR
superman:network mumu$ make clean
rm -fr ../../obj
rm ../../nnt/string_defs.h
superman:network mumu$ make run_single_zone
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
superman:network mumu$
superman:network mumu$ export BOOST_LIB_DIR=/Users/mumu/boost/stage/lib
superman:network mumu$ echo $BOOST_DIR
/Users/mumu/boost
superman:network mumu$ echo $BOOST_LIB_DIR
/Users/mumu/boost/stage/lib
Then
superman:network mumu$ make clean
rm -fr ../../obj
rm ../../nnt/string_defs.h
superman:network mumu$ make run_single_zone
In this way it works.
But the same problem come again:
superman:network mumu$ ls run_single_zone
run_single_zone
superman:network mumu$ ./run_single_zone
Still can not work.
At the same time GCC can not be set right. I also think the clang lib is not set correctly when installing it.
I set the in .bash_profile:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/autotools/lib:/opt/local/lib:/opt/local/include/lib:/Users/mumu/boost/stage/lib
And then I try to run cern root:
superman:~ mumu$ root
dyld: Symbol not found: _CGLGetCurrentContext
Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Trace/BPT trap: 5
then I change back
and run cern root, it is still:
superman:~ mumu$ root
dyld: Symbol not found: _CGLGetCurrentContext
Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Trace/BPT trap: 5
Dear Professor Meyer,
I try the following: 1. set_clang
superman:~ mumu$ set_clang
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ source .bash_profile
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ clang
clang: error: no input files
superman:~ mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
It seems clang works and then I try set_gcc
2. set_gcc
superman:~ mumu$ set_gcc
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:~ mumu$ source .bash_profile
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
GCC setting seems still not working, so I use clang to compile as following:
3.make run_single_zone using clang
superman:~ mumu$ set_clang
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ souce .bash_profile
-bash: souce: command not found
superman:~ mumu$ source .bash_profile
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
I got the same error as before and I think the clang library is not set correctly.
I set the enviroments as last Reply above and still have the same problem.
Sorry for the problems and thanks so much for your help.
Besrt wishes and be happy all the time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Let's first try solving the compiler issue. I suggest you make sure you are using the .bash_profile in your home directory. Try
cd ~
Now add the lines
export NNT_NO_OPENMP=1
##
# set compiler
##
alias set_clang='sudo port select --set gcc none; source ~/.bash_profile; unset BOOST_LIB_DIR; export NNT_NO_OPENMP=1'
alias set_gcc='sudo port select --set gcc mp-gcc5; source ~/.bash_profile; unset NNT_NO_OPENMP; export BOOST_LIB_DIR=/Users/bradleymeyer/boost/stage/lib'
to the .bash_profile in your home directory. Notice carefully the source ~/.bash_profile in both aliases and also the position (right after sudo port ...). Of course use your account name instead of bradleymeyer. Now try
source ~/.bash_profile
set_clang
gcc -v
Does that work (gives clang)? Now try
set_gcc
gcc -v
Does that work (gives gcc)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure what's happening, but I suspect it is more of an annoyance than a problem and that your gcc is in fact loading correctly. You might try the following:
set_clang
which gcc
I get the following response:
/usr/bin/gcc
If I type
/usr/bin/gcc -v
I get
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
If I type
gcc
I get
clang: error: no input files
which shows that in default mode, Apple has "aliased" gcc as clang. If I now type
Dear Professor Meyer,
I do the same as you list above, and just one place is not the same:
superman:~ mumu$ /opt/local/bin/gcc -v
-bash: /opt/local/bin/gcc: No such file or directory
Maybe this is the place that make it do not work. Hoe can I solve the problem to correct it?
I use this way to set GCC before and it finally can compile but can not produce the xml files:
export PATH=$PATH:/opt/local/bin/
alias gcc='/opt/local/bin/gcc'
alias g++='/opt/local/bin/g++'
Thanks very much
Best regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would recommend against aliasing gcc and g++. You should let port select do that. I would thus remove the alias of gcc and g++. I'd also remove the export of /opt/local/bin--mac ports should have added that already to your .bash_profile when it got installed.
You may have unset gcc before doing
/opt/local/bin/gcc -v
Try
sudo port select --set gcc mp-gcc5
/opt/local/bin/gcc -v
Does that work?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This time it seems it work for /opt/local/bin/gcc -v.
But when I
superman:network mumu$ make run_single_zone
at the last few lines coming out the same problem:
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
Sorry for the still coming problem.
Best wishes,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The first two are versions that I compiled with gcc (mp-gcc5). The last (/opt/local/lib/libboost_program_options-mt.dylib) is the one downloaded with Mac Ports and is used with clang.
Notice the -mt at the end. To get clang to compile with this, I would type
export BOOST_MT=1
make run_single_zone
That should work. Let me know. Best wishes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Professor Meyer,
I have install visualbox on my mac to run it and the nucnet-tools is installed there. I will go for the Network school and see you next week. Maybe you can help me solve it face to face.
I type: superman:network mumu$ locate libboost_program_options
It still has the ame problem. I firstly think my system have some problem and I updated it two days ago. Meanwhile I updated macport.
Still coming the problem.
I will use the linux in visualbox first and when iI meet you next week I will ask you for help.
Thanks so much for you help and the patience you had for us.
Really grateful for your work and help.
Best regards and hope you be happy, with good health everyday.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your post. It looks like you are compiling with gcc. The code then tries to link to the boost program options library but doesn't find it. If gcc is the default compiler, your version of XCode may be old, and you might want to update it. You might then try the steps in this blog post, including reinstalling Boost. Let me know if you still have trouble. Best wishes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Sir,
When I run the newest revision 492 using the command below, but it run well for linux
/nucnet-tools-code/examples/network/make run_single_zone
I have the probelm and together with many waringings :
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
my boost can run the exampe:https://sourceforge.net/u/mbradle/wiki/BoostCompile/
Thanks for your post. Are you saying that you were able to download, compile, and run the code on linux but not on a mac? If this is correct, on your mac, could you do
cd nucnet-tools-code/examples/network
make run_single_zone &> log
and attach log to your reply? Thanks, and best wishes.
Last edit: Bradley S. Meyer 2016-07-27
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor,
I clean and run again, and the attached file wiht the run information is list below.
Thanks very much
It looks like it successfully compiled with clang. Is there still a problem? You might also be interested in this blog post.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear professor,
I have follow the way to do that, but I still get the error everytime about the library"lgomp" as below.
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
Thanks for your post. It looks like it may be this issue. Did you do
export NNT_NO_OPENMP=1
make clean
make run_single_zone
That way your compilation won't pass the -fopenmp flag which should then cause the compiler to avoid trying to link to libgomp, which you apparently don't have.
You might also want to upgrade your XCode since the newer versions of clang seem to have settled on the OpenMP library. Let me know if you have further trouble. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Sir,
I have successfully compiled the test_versions and run_single_zone,
but when I try this comand:
./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml my_output.xml "[z <= 10]"
I got the result:
Couldn't open file my_output.xml!
I can not get access to the files , and I tried seceral times. The results is the same.
Thanks for your post. That's a curious error. Do you have write permission to that directory? Does my_output.xml already exist? You might try
ls -l my_output.xml
If the file exists, you should see
If you don't have write permission (the w), the file can't be written to. If the file doesn't exist, you probably don't have write access to the directory.
You could try changing the name from my_output.xml (say, to my_out.xml) and rerunning, or simply removing my_output.xml by typing
rm my_output.xml
and rerunning. Let me know if you still have trouble. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Meyer,
I have tried another way to compile the run_single_zone as you list for us:
unset BOOST_LIB_DIR
export NNT_NO_OPENMP=1
sudo port select --set gcc none
I can now type
make clean
make run_entropy
This successfully compiles the code with clang. To again compile with gcc, I type
unset NNT_NO_OPENMP
export BOOST_LIB_DIR=/Users/bradleymeyer/boost/stage/lib
sudo port select --set gcc mp-gcc5
I now compile by typing
make clean
make run_entropy
It is successfully to make it compiled.
But the after the two ways when I make the command:
./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
the result is still:
Couldn't open file traj.txt!
my termianl screen is like below:
Make succeeded.
superman:network mumu$ ls
Makefile run_energy_generation.cpp run_multiple_zone_omp1
examples_make run_entropy run_single_zone
run_constant_entropy run_entropy.cpp run_single_zone.cpp
run_constant_entropy.cpp run_multiple_zone_omp
run_energy_generation run_multiple_zone_omp.cpp
superman:network mumu$ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
Couldn't open file traj.txt!
superman:network mumu$ ls -l
total 29384
-rw-r--r-- 1 mumu staff 4952 8 8 20:25 Makefile
-rwxr-xr-x 1 mumu staff 1023 8 8 20:25 examples_make
-rwxr-xr-x 1 mumu staff 2346796 8 10 11:12 run_constant_entropy
-rw-r--r-- 1 mumu staff 12806 8 8 20:25 run_constant_entropy.cpp
-rwxr-xr-x 1 mumu staff 2758944 8 10 11:13 run_energy_generation
-rw-r--r-- 1 mumu staff 24226 8 8 20:25 run_energy_generation.cpp
-rwxr-xr-x 1 mumu staff 2771904 8 10 11:13 run_entropy
-rw-r--r-- 1 mumu staff 24041 8 8 20:25 run_entropy.cpp
-rwxr-xr-x 1 mumu staff 2343292 8 10 11:13 run_multiple_zone_omp
-rw-r--r-- 1 mumu staff 11650 8 8 20:25 run_multiple_zone_omp.cpp
-rwxr-xr-x 1 mumu staff 2331204 8 8 20:41 run_multiple_zone_omp1
-rwxr-xr-x 1 mumu staff 2375652 8 10 11:13 run_single_zone
-rw-r--r-- 1 mumu staff 14847 8 8 20:25 run_single_zone.cpp
superman:network mumu$ chmod 777 *
superman:network mumu$ ls
Makefile run_energy_generation.cpp run_multiple_zone_omp1
examples_make run_entropy run_single_zone
run_constant_entropy run_entropy.cpp run_single_zone.cpp
run_constant_entropy.cpp run_multiple_zone_omp
run_energy_generation run_multiple_zone_omp.cpp
superman:network mumu$ ls -l
total 29384
-rwxrwxrwx 1 mumu staff 4952 8 8 20:25 Makefile
-rwxrwxrwx 1 mumu staff 1023 8 8 20:25 examples_make
-rwxrwxrwx 1 mumu staff 2346796 8 10 11:12 run_constant_entropy
-rwxrwxrwx 1 mumu staff 12806 8 8 20:25 run_constant_entropy.cpp
-rwxrwxrwx 1 mumu staff 2758944 8 10 11:13 run_energy_generation
-rwxrwxrwx 1 mumu staff 24226 8 8 20:25 run_energy_generation.cpp
-rwxrwxrwx 1 mumu staff 2771904 8 10 11:13 run_entropy
-rwxrwxrwx 1 mumu staff 24041 8 8 20:25 run_entropy.cpp
-rwxrwxrwx 1 mumu staff 2343292 8 10 11:13 run_multiple_zone_omp
-rwxrwxrwx 1 mumu staff 11650 8 8 20:25 run_multiple_zone_omp.cpp
-rwxrwxrwx 1 mumu staff 2331204 8 8 20:41 run_multiple_zone_omp1
-rwxrwxrwx 1 mumu staff 2375652 8 10 11:13 run_single_zone
-rwxrwxrwx 1 mumu staff 14847 8 8 20:25 run_single_zone.cpp
superman:network mumu$ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
Couldn't open file traj.txt!
Another problem is that I can not use the command:
sudo port select --set gcc mp-gcc5
Password:
Sorry, try again.
Password:
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:analysis mumu$ sudo port select --set gcc mp-gcc5
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:analysis mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
superman:analysis mumu$ sudo port select --list gcc
Available versions for gcc:
mp-gcc49
mp-gcc5 (active)
none
superman:analysis mumu$ which gcc
/usr/bin/gcc
It seems gcc is correctly but not be shown the right way as after the command 'gcc -v'
I use this way to set GCC:
export PATH=$PATH:/opt/local/bin/gcc
alias gcc='/opt/local/bin/gcc'
alias g++='/opt/local/bin/g++'
Can you help me manage to make 'sudo port select --set gcc mp-gcc5' really work on my Mac PC?
There seem to be two issues here.
1) Not finding the trajectory file. Be sure that you compiled against the right hydro code. If you type
./run_single_zone
you'll get a usage statement. If the usage statment does not ask for a trajectory file, then you've compile against the wrong hydro code. Be sure to supply the trajectory file--it is input.
2) If you use set_gcc and set_clang, as I described, the compiler will be properly set but it might not show the right command with gcc -v. You might need to source ~./bash_profile to show that. In my case, I could fix that by changing the lines in the ~/.bash_profile file to include source .bash_profile: In my case:
Now I get the right response (after typing source ~/.bash_profile):
set_clang
gcc -v
returns
and
set_gcc
gcc -v
which returns
Let me know if this doesn't work or if you find a better solution. Best wishes.
Note: edited to change position of source ~/.bash_profile in aliases.
Last edit: Bradley S. Meyer 2016-08-11
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor Meyer,
I run as following:
mv run_single_zone run_single_zone1
make clean
rm -fr ../../obj
rm ../../nnt/string_defs.h
superman:network mumu$ make run_single_zone
superman:network mumu$ ls
Makefile run_energy_generation.cpp run_single_zone
examples_make run_entropy.cpp run_single_zone.cpp
run_constant_entropy run_multiple_zone_omp run_single_zone1
run_constant_entropy.cpp run_multiple_zone_omp.cpp
run_energy_generation run_multiple_zone_omp1
superman:network mumu$ ./run_single_zone
Usage: ./run_single_zone net_file zone_file traj_file out_file xpath_nuc xpath_reac
net_file = input network data xml filename
zone_file = input zone data xml filename
traj_file = trajectory text file
out_file = output xml file
xpath_nuc = nuclear xpath expression (optional--required if xpath_reac specified)
xpath_reac = reaction xpath expression (optional)
superman:network mumu$ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml my_output.xml "[z <= 10]"
Couldn't open file my_output.xml!
then I tried to use example,
superman:network mumu$ ./run_single_zone --example
./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
superman:network mumu$ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
Couldn't open file traj.txt!
When I set the environments in ~/bash_profile: ##
# set compiler
##
alias set_clang='sudo port select --set gcc none; unset BOOST_LIB_DIR; export \ NNT_NO_OPENMP=1'
alias set_gcc='sudo port select --set gcc mp-gcc5; unset NNT_NO_OPENMP; export\ BOOST_LIB_DIR=/Users/mumu/boost/stage/lib'
1.I tried to set gcc first, but I get
superman:network mumu$ set_gcc
Password:
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:network mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
It seems it does not set correctly and if I run
superman:network mumu$ make run_single_zone
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
2.when I set clang
superman:network mumu$ set_clang
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:network mumu$ echo $BOOST_LIB_DIR
superman:network mumu$ make clean
rm -fr ../../obj
rm ../../nnt/string_defs.h
superman:network mumu$ make run_single_zone
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
superman:network mumu$
superman:network mumu$ export BOOST_LIB_DIR=/Users/mumu/boost/stage/lib
superman:network mumu$ echo $BOOST_DIR
/Users/mumu/boost
superman:network mumu$ echo $BOOST_LIB_DIR
/Users/mumu/boost/stage/lib
Then
superman:network mumu$ make clean
rm -fr ../../obj
rm ../../nnt/string_defs.h
superman:network mumu$ make run_single_zone
In this way it works.
But the same problem come again:
superman:network mumu$ ls run_single_zone
run_single_zone
superman:network mumu$ ./run_single_zone
Usage: ./run_single_zone net_file zone_file traj_file out_file xpath_nuc xpath_reac
net_file = input network data xml filename
zone_file = input zone data xml filename
traj_file = trajectory text file
out_file = output xml file
xpath_nuc = nuclear xpath expression (optional--required if xpath_reac specified)
xpath_reac = reaction xpath expression (optional)
superman:network mumu$
superman:network mumu$ make data
wget http://nucnet-tools.sourceforge.net/data_pub/2013-04-19/nnt_data.tar.gz
--2016-08-11 15:26:27-- http://nucnet-tools.sourceforge.net/data_pub/2013-04-19/nnt_data.tar.gz
Resolving nucnet-tools.sourceforge.net... 216.34.181.96
Connecting to nucnet-tools.sourceforge.net|216.34.181.96|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3782483 (3.6M) [application/x-gzip]
Saving to: 'nnt_data.tar.gz'
nnt_data.tar.gz 100%[===================>] 3.61M 435KB/s in 8.4s
2016-08-11 15:26:37 (440 KB/s) - 'nnt_data.tar.gz' saved [3782483/3782483]
mkdir -p ../../data_pub
tar xz -C ../../data_pub -f nnt_data.tar.gz
rm nnt_data.tar.gz
superman:network mumu$
superman:network mumu$ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml my_output.xml "[z <= 10]"
Couldn't open file my_output.xml!
superman:network mumu$
Still can not work.
At the same time GCC can not be set right. I also think the clang lib is not set correctly when installing it.
I set the in .bash_profile:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/autotools/lib:/opt/local/lib:/opt/local/include/lib:/Users/mumu/boost/stage/lib
And then I try to run cern root:
superman:~ mumu$ root
dyld: Symbol not found: _CGLGetCurrentContext
Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Trace/BPT trap: 5
then I change back
and run cern root, it is still:
superman:~ mumu$ root
dyld: Symbol not found: _CGLGetCurrentContext
Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Trace/BPT trap: 5
but before that:
superman:~ mumu$ root
I can not solve the problem till now.
Sorry for the questions, I am also really fractrusted about it.
Thanks very much. Best wishes
Sorry for the frustration. Let's first try the following. Type
set_clang
source ~/.bash_profile
gcc -v
Does this show clang? Then
set_gcc
source ~/.bash_profile
gcc -v
Does this show your gcc version 5.4.0 (or similar)?
Next, if that works, choose clang or gcc and go into your network directory. Type
unset NNT_HYDRO_CODE
make clean
make run_single_zone
If that compiles, type
make data
./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml my_output.xml "[z <= 10]"
If that works, then try following the steps at the nova post carefully. Let me know how that goes. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor Meyer,
I try the following:
1. set_clang
superman:~ mumu$ set_clang
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ source .bash_profile
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ clang
clang: error: no input files
superman:~ mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
It seems clang works and then I try set_gcc
2. set_gcc
superman:~ mumu$ set_gcc
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:~ mumu$ source .bash_profile
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
GCC setting seems still not working, so I use clang to compile as following:
3.make run_single_zone using clang
superman:~ mumu$ set_clang
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ souce .bash_profile
-bash: souce: command not found
superman:~ mumu$ source .bash_profile
Selecting 'none' for 'gcc' succeeded. 'none' is now active.
superman:~ mumu$ clang
clang: error: no input files
superman:~ mumu$ unset NNT_HYDRO_CODE
superman:~ mumu$ cd nucnet-tools-code/
superman:nucnet-tools-code mumu$ cd examples/network/
superman:network mumu$ make clean
rm -fr ../../obj
rm ../../nnt/string_defs.h
superman:network mumu$ make run_single_zone
tar xz -C ../../vendor -f ../../vendor/wn_matrix.tar.gz
g++ -Werror -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -fshort-enums -fno-common -g -Wno-error=unused-local-typedef -O0 -DNO_OPENMP -Wno-deprecated -DHYDRO_EXP_EXPANSION -I/Users/mumu/boost
xml2-config --cflags
gsl-config --cflags
-I../../vendor/libnucnet/0.28/src -I../../vendor/wn_matrix/0.18/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.5/src -c ../../vendor/wn_matrix/0.18/src/WnMatrix.c -o ../../obj/WnMatrix.otar xz -C ../../vendor -f ../../vendor/libnucnet.tar.gz
g++ -Werror -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -fshort-enums -fno-common -g -Wno-error=unused-local-typedef -O0 -DNO_OPENMP -Wno-deprecated -DHYDRO_EXP_EXPANSION -I/Users/mumu/boost
xml2-config --cflags
gsl-config --cflags
-I../../vendor/libnucnet/0.28/src -I../../vendor/wn_matrix/0.18/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.5/src ../../obj/WnMatrix.o ../../obj/LibnucnetNuc.o ../../obj/LibnucnetReac.o ../../obj/Libnucnet.o ../../obj/Libstatmech.o ../../obj/Libnuceq.o ../../obj/auxiliary.o ../../obj/iter.o ../../obj/math.o ../../obj/two_d_weak_rates.o ../../obj/wrappers.o ../../obj/hydro.o ../../obj/hydro_helper.o ../../obj/matrix_solver.o ../../obj/evolve.o ../../obj/network_limiter.o ../../obj/user_rate_functions.o ../../obj/flow_utilities.o ../../obj/aa522a25.o ../../obj/neutrino_rate_functions.o ../../obj/network_utilities.o ../../obj/rate_modifiers.o ../../obj/screen.o ../../obj/thermo.o ../../obj/nse_corr.o ../../obj/weak_utilities.o ../../obj/remove_duplicate.o ../../obj/run_single_zone.o -o ./run_single_zone -lboost_program_optionsxml2-config --libs
gsl-config --libs
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
I got the same error as before and I think the clang library is not set correctly.
I set the enviroments as last Reply above and still have the same problem.
Sorry for the problems and thanks so much for your help.
Besrt wishes and be happy all the time.
Let's first try solving the compiler issue. I suggest you make sure you are using the .bash_profile in your home directory. Try
cd ~
Now add the lines
to the .bash_profile in your home directory. Notice carefully the source ~/.bash_profile in both aliases and also the position (right after sudo port ...). Of course use your account name instead of bradleymeyer. Now try
source ~/.bash_profile
set_clang
gcc -v
Does that work (gives clang)? Now try
set_gcc
gcc -v
Does that work (gives gcc)?
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor Meyer,
I am sorry, I reply last night and I thought we have big time difference. So just moe I saw your reply.
I did it as folloeing:
add the lines in my ~/.bash_profile
export NNT_NO_OPENMP=1
##
# set compiler
##
alias set_clang='sudo port select --set gcc none; source ~/.bash_profile; unset BOOST_LIB_DIR; export NNT_NO_OPENMP=1'
alias set_gcc='sudo port select --set gcc mp-gcc5; source ~/.bash_profile; unset NNT_NO_OPENMP; export BOOST_LIB_DIR=/Users/bradleymeyer/boost/stage/lib'
superman:~ mumu$ source ~/.bash_profile
the same problem come again:
superman:~ mumu$ set_gcc
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.
superman:~ mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
It seems that GCC is still not setting as planned.
I am sorry for this problem. Thanks very much.
Best regards.
I'm not sure what's happening, but I suspect it is more of an annoyance than a problem and that your gcc is in fact loading correctly. You might try the following:
set_clang
which gcc
I get the following response:
If I type
/usr/bin/gcc -v
I get
If I type
gcc
I get
which shows that in default mode, Apple has "aliased" gcc as clang. If I now type
set_gcc
which gcc
I get
If I type
/opt/local/bin/gcc -v
I get
If I type
gcc
I get
What happens if you do this? Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor Meyer,
I do the same as you list above, and just one place is not the same:
superman:~ mumu$ /opt/local/bin/gcc -v
-bash: /opt/local/bin/gcc: No such file or directory
Maybe this is the place that make it do not work. Hoe can I solve the problem to correct it?
I use this way to set GCC before and it finally can compile but can not produce the xml files:
export PATH=$PATH:/opt/local/bin/
alias gcc='/opt/local/bin/gcc'
alias g++='/opt/local/bin/g++'
Thanks very much
Best regards,
I would recommend against aliasing gcc and g++. You should let port select do that. I would thus remove the alias of gcc and g++. I'd also remove the export of /opt/local/bin--mac ports should have added that already to your .bash_profile when it got installed.
You may have unset gcc before doing
/opt/local/bin/gcc -v
Try
sudo port select --set gcc mp-gcc5
/opt/local/bin/gcc -v
Does that work?
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor Meyer,
I works this time, thanks so much and I also tried:
1.
superman:~ mumu$ unset gcc
superman:~ mumu$ gcc -v
Configured with: --prefix=/applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
superman:~ mumu$ /opt/local/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/local/bin/gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin15/5.4.0/lto-wrapper
Target: x86_64-apple-darwin15
Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.4.0/configure --prefix=/opt/local --build=x86_64-apple-darwin15 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc5 --includedir=/opt/local/include/gcc5 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-5 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-5 --with-gxx-include-dir=/opt/local/include/gcc5/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc5 5.4.0_0+universal'
Thread model: posix
gcc version 5.4.0 (MacPorts gcc5 5.4.0_0+universal)
This time it seems it work for /opt/local/bin/gcc -v.
But when I
superman:network mumu$ make run_single_zone
at the last few lines coming out the same problem:
ld: library not found for -lboost_program_options
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [run_single_zone] Error 1
Sorry for the still coming problem.
Best wishes,
In this case you are compiling with clang but the compiler is not finding the program options library. If you type
locate libboost_program_options
I suspect you'll see something like
The first two are versions that I compiled with gcc (mp-gcc5). The last (/opt/local/lib/libboost_program_options-mt.dylib) is the one downloaded with Mac Ports and is used with clang.
Notice the -mt at the end. To get clang to compile with this, I would type
export BOOST_MT=1
make run_single_zone
That should work. Let me know. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Professor Meyer,
I have install visualbox on my mac to run it and the nucnet-tools is installed there. I will go for the Network school and see you next week. Maybe you can help me solve it face to face.
I type:
superman:network mumu$ locate libboost_program_options
/Users/mumu/boost/bin.v2/libs/program_options/build/darwin-4.2.1/release/link-static/threading-multi/libboost_program_options.a
/Users/mumu/boost/bin.v2/libs/program_options/build/darwin-4.2.1/release/threading-multi/libboost_program_options.dylib
/Users/mumu/boost/stage/lib/libboost_program_options.a
/Users/mumu/boost/stage/lib/libboost_program_options.dylib
/opt/local/include/lib/libboost_program_options.dylib
/opt/local/lib/libboost_program_options-mt.dylib
the upper is included ,as well the source boost libary I download but not listed above.
When I type
superman:network mumu$ export BOOST_MT=1
superman:network mumu$ make run_single_zone
g++ -Werror -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -fshort-enums -fno-common -g -Wno-error=unused-local-typedef -O0 -DNO_OPENMP -Wno-deprecated -DHYDRO_TRAJ -I/Users/mumu/boost
xml2-config --cflags
gsl-config --cflags
-I../../vendor/libnucnet/0.28/src -I../../vendor/wn_matrix/0.18/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.5/src -c -o ../../obj/run_single_zone.o run_single_zone.cppg++ -Werror -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -fshort-enums -fno-common -g -Wno-error=unused-local-typedef -O0 -DNO_OPENMP -Wno-deprecated -DHYDRO_TRAJ -I/Users/mumu/boost
xml2-config --cflags
gsl-config --cflags
-I../../vendor/libnucnet/0.28/src -I../../vendor/wn_matrix/0.18/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.5/src ../../obj/WnMatrix.o ../../obj/LibnucnetNuc.o ../../obj/LibnucnetReac.o ../../obj/Libnucnet.o ../../obj/Libstatmech.o ../../obj/Libnuceq.o ../../obj/auxiliary.o ../../obj/iter.o ../../obj/math.o ../../obj/two_d_weak_rates.o ../../obj/wrappers.o ../../obj/hydro.o ../../obj/hydro_helper.o ../../obj/matrix_solver.o ../../obj/evolve.o ../../obj/network_limiter.o ../../obj/user_rate_functions.o ../../obj/flow_utilities.o ../../obj/aa522a25.o ../../obj/neutrino_rate_functions.o ../../obj/network_utilities.o ../../obj/rate_modifiers.o ../../obj/screen.o ../../obj/thermo.o ../../obj/nse_corr.o ../../obj/weak_utilities.o ../../obj/remove_duplicate.o ../../obj/run_single_zone.o -o ./run_single_zone -lboost_program_options-mtxml2-config --libs
gsl-config --libs
superman:network mumu$ ./run_single_zone
Usage: ./run_single_zone net_file zone_file traj_file out_file xpath_nuc xpath_reac
net_file = input network data xml filename
zone_file = input zone data xml filename
traj_file = trajectory text file
out_file = output xml file
xpath_nuc = nuclear xpath expression (optional--required if xpath_reac specified)
xpath_reac = reaction xpath expression (optional)
superman:network mumu$ ./run_single_zone --example
./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
superman:network mumu$ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml traj.txt my_output.xml "[z <= 20]"
Couldn't open file traj.txt!
superman:network mumu$
It still has the ame problem. I firstly think my system have some problem and I updated it two days ago. Meanwhile I updated macport.
Still coming the problem.
I will use the linux in visualbox first and when iI meet you next week I will ask you for help.
Thanks so much for you help and the patience you had for us.
Really grateful for your work and help.
Best regards and hope you be happy, with good health everyday.
Ok. We'll fix it face to face and post the results if they are generally useful. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Meyer
I have trouble with "./run_single_zone". Do you know how to modify it?
mac OSX 10.9.5
../../obj/remove_duplicate.o ../../obj/run_single_zone.o -o ./run_single_zone -lboost_program_options
xml2-config --libs
gsl-config --libs
ld: library not found for -lboost_program_options
collect2: error: ld returned 1 exit status
make: *** [run_single_zone] Error 1
best wishes
Thanks for your post. It looks like you are compiling with gcc. The code then tries to link to the boost program options library but doesn't find it. If gcc is the default compiler, your version of XCode may be old, and you might want to update it. You might then try the steps in this blog post, including reinstalling Boost. Let me know if you still have trouble. Best wishes.