Hi folks: I found if I created a symbolic link from a g++4.7 compiler to /usr/bin/g++, I could "trick" phaser into compiling with OpenMP enabled. This is kind of an ugly hack. How do I force it to use /sw/bin/g++-4 ? Is there some place in the source code for cctbx (or phaser) that I can make such a change? Thanks. Bil William G. Scott Professor Department of Chemistry and Biochemistry and The Center for the Molecular Biology of RNA 228 Sinsheimer Laboratories University of California at Santa Cruz Santa Cruz, California 95064 USA
Hi,
I found if I created a symbolic link from a g++4.7 compiler to /usr/bin/g++, I could "trick" phaser into compiling with OpenMP enabled.
This is kind of an ugly hack. How do I force it to use /sw/bin/g++-4 ? Is there some place in the source code for cctbx (or phaser) that I can make such a change?
May I ask on which platform you work? In any case, the orthodox way to do that would be to pass --compiler=gcc-4.7 to libtbx/configure.py but one would need to modify libtbx/SConscript to support that version. I suggest searching for the string "darwin_gcc-4.2" in that file to see how it has been done for --compiler=gcc-4.2. This SConscript is already an utter mess but well… Best wishes, Luc
On Sep 17, 2012, at 4:32 AM, Luc Bourhis
Hi,
I found if I created a symbolic link from a g++4.7 compiler to /usr/bin/g++, I could "trick" phaser into compiling with OpenMP enabled.
This is kind of an ugly hack. How do I force it to use /sw/bin/g++-4 ? Is there some place in the source code for cctbx (or phaser) that I can make such a change?
May I ask on which platform you work?
OS X, 10.8.1, most recent dev tools. gcc-4.7 installed via fink: % /usr/bin/gcc --version |head -n 1 i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) % /usr/bin/cc --version |head -n 1 Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn) % /sw/bin/gcc-4 --version |head -n 1 gcc-4 (GCC) 4.7.1
In any case, the orthodox way to do that would be to pass --compiler=gcc-4.7 to libtbx/configure.py but one would need to modify libtbx/SConscript to support that version. I suggest searching for the string "darwin_gcc-4.2" in that file to see how it has been done for --compiler=gcc-4.2. This SConscript is already an utter mess but well…
OK, I'll dig into it. I didn't know where to begin. Thanks. Bill
Best wishes,
Luc
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
On Sep 17, 2012, at 4:32 AM, Luc Bourhis wrote:
one would need to modify libtbx/SConscript to support that version.
Thanks again for your help. This made it work: ------------------------------------------------------------------------------------------------------------------- --- SConscript.orig 2012-09-17 13:55:45.000000000 -0700 +++ SConscript 2012-09-17 13:59:56.000000000 -0700 @@ -682,7 +682,7 @@ if cc == 'clang': cxx = 'clang++' else: - cxx = cc.replace('gcc', 'g++') + cxx = cc.replace('gcc', '/sw/bin/g++-4') if env_etc.compiler.endswith("4.2"): if libtbx.env.build_options.enable_boost_threads: build_nb = libtbx.env_config.get_darwin_gcc_build_number(gcc=cxx) ------------------------------------------------------------------------------------------------------------------- Then I just configured with --compiler=gcc (and --enable-openmp-if-possible=True ) The resulting binary links the relevant lib: % otool -L exe/phaser exe/phaser: /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.17.0) /sw/lib/gcc4.7/lib/libgomp.1.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) /sw/lib/gcc4.7/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
Hi William,
This made it work:
------------------------------------------------------------------------------------------------------------------- --- SConscript.orig 2012-09-17 13:55:45.000000000 -0700 +++ SConscript 2012-09-17 13:59:56.000000000 -0700 @@ -682,7 +682,7 @@ if cc == 'clang': cxx = 'clang++' else: - cxx = cc.replace('gcc', 'g++') + cxx = cc.replace('gcc', '/sw/bin/g++-4') if env_etc.compiler.endswith("4.2"): if libtbx.env.build_options.enable_boost_threads: build_nb = libtbx.env_config.get_darwin_gcc_build_number(gcc=cxx)
-------------------------------------------------------------------------------------------------------------------
well, sure enough! We should seriously think how to avoid the need for such hacks though. It's been on my todo list for ever to come with a mechanism to ease using non-standard compilers but it's never been important enough that I acted upon it. Best wishes, Luc
participants (2)
-
Luc Bourhis
-
William G. Scott