no setup.py unless Release mode

Issue #446 resolved
Frank Dellaert created an issue

When I compiled gtsam with RelWithDebInfo I got directories

gtsamRelWithDebInfo     gtsam_eigency           gtsam_unstableRelWithDebInfo

in the cython install directory, but no setup.py. Assigning @matt_broadway to comment and possibly fix.

Comments (7)

  1. matthew.broadway

    there are other issues than just setup.py when compiling with -DCMAKE_BUILD_TYPE=RELWITHDEBINFO as well, and probably with any other build type with a suffix.

    The setup.py gets generated to the build directory, but if you try to import gtsam from the build directory it fails because __init__.py is looking for gtsam.so but the library gets named gtsamRelWithDebInfo.so.

    When running make install, the __init__.py and setup.py get written to install/cythonRelWithDebInfo/gtsam but the .pyx and .so files get written to install/cython/gtsamRelWithDebInfo, probably because the paths are hard-coded in cython/CMakeLists.txt

  2. Varun Agrawal

    Is there a way to force CMake to not do this? I am currently affected by this and it is making debugging GTSAM with the Python wrapper impossible.

    For now, I’ve just renamed the various directories and .so files, but there should be a better way.

  3. Frank Dellaert reporter

    The “right way” is to fix the cmake scripts so it correctly generates and installs a debug version of the wrapper.

  4. Frank Dellaert reporter

    @matt_broadway is this something you might be able to fix? I don’t know where to begin, but you seem to have a good grasp on it.

  5. matthew.broadway

    building with the latest develop, the build/cython/gtsam, build/cython/gtsam_unstable and install/cython directories don't seem to have the suffix anymore when compiling with -DCMAKE_BUILD_TYPE=RELWITHDEBINFO, however build/cython/gtsamRelWithDebInfo.sohas the suffix so there is still a problem. I found that a flag is already offered which prevents the suffix from being added: -DGTSAM_BUILD_TYPE_POSTFIXES=OFF. by default it is ON. (when set to OFF everything works OK because the paths are exactly as they would be in release mode)

    is it desirable to have the python bindings work even when suffixes are present, or should they just be disabled when generating python bindings?

  6. Frank Dellaert reporter

    Ah, well, that makes it easy 🙂 I propose a little cmake check that turns off the postfixes if the matlab or cython wrappers are asked for, and tells the user about it at ccmake time.

  7. Log in to comment