pele-python / mcpele

Monte Carlo and parallel tempering routines built on the pele foundation
Other
20 stars 5 forks source link

add an alternate setup file which uses cmake #50

Closed js850 closed 10 years ago

js850 commented 10 years ago

this allows for building in parallel and for building the library only once rather than once for each .so file

smcantab commented 10 years ago

bear in mind that to compile with cmake on the clusters one needs to overwrite the paths of the c and cxx compilers doing "CC=path/to/gcc CXX=path/to/g++ cmake dir", that's because cmake picks up the wrong paths, even if the correct modules are loaded. More info here:

http://www.cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools

It seems that to change compiler you have to wipe out your build tree and start over. I have tried adding the set(CMAKE_C_COMPILER_INIT) options of sort but it didn't work. The suggestion above was give to me by Catherine and it seems to be the only thing that works.

On Wed, Oct 8, 2014 at 4:30 PM, Jacob Stevenson notifications@github.com wrote:

this allows for building in parallel and for building the library only

once rather than once for each .so file

You can merge this Pull Request by running

git pull https://github.com/js850/mcpele cmake_setup

Or view, comment on, or merge it at:

https://github.com/pele-python/mcpele/pull/50 Commit Summary

  • start to add setup with cmake
  • Merge branch 'master' of github.com:pele-python/mcpele into cmake_setup
  • get CMakeLists working
  • add function to CMakeLists.txt
  • cmake setup now works with mcpele

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/pele-python/mcpele/pull/50.

kjs73 commented 10 years ago

Amazing! On my computer this is 5.6 seconds (setup_with_cmake.py) versus 1 min 37 seconds (setup.py).

js850 commented 10 years ago

I'm going to merge this. Try it and let me know how it works. We should keep the original setup.py until all the issues are ironed out of this one. some issues::

  1. How do we pass compilation flags from setup.py to cmake?

. how do we change which c-compiler to use.

. all cmake builds are in the same folder. Normally they would be in different folders corresponding to different types of builds. Can we build cmake in, e.g. build/lib.linux-x86_64-2.7/

smcantab commented 10 years ago

in PR https://github.com/pele-python/mcpele/pull/51 I propose a tentative solution to issues 1 and 2 of Jake's comment above.