SourceXtractorPlusPlus icon indicating copy to clipboard operation
SourceXtractorPlusPlus copied to clipboard

SX++ fails when installed in /usr/local/bin/

Open ebertin opened this issue 3 years ago • 5 comments

SX++ stops with the error message

2021-09-15T14:35:20HST SourceXtractor FATAL : No module named '_SourceXtractorPy' 

if it is installed with the traditional build procedure (executable installed in /usr/local/bin/):

$ mkdir build
$ cd build
$ cmake ..
$ make

I understand that this may not be the recommended way of building and installing, but this is what most users would do before reading the manual :wink: .

ebertin avatar Sep 22 '21 19:09 ebertin

I can't build the project at all using this method. I don't think it's supported maybe @degauden can confirm?

marcschefer avatar Dec 09 '21 16:12 marcschefer

No. It is supported. It has to.

The fallback on the default CMake build method should work.

Please note (maybe I am stating evidences):

  • The default reference location (/usr) and default install location (/usr/local) of CMake are different.

which means that chaining the build and installation installation of Elements, Alexandria and SX++ would require, either (for all the projects):

A) from/to the /usr/local prefix $ mkdir build $ cd build $ cmake -DCMAKE_PREFIX_PATH=/usr/local .. $ make $ make install

B) From/to the /usr prefix (not recommended) $ mkdir build $ cd build $ cmake -DCMAKE_INSTALL_PREFIX=/usr .. $ make $ sudo make install

C) from/to the custom prefix $HOME/.local $ mkdir build $ cd build $ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_PREFIX_PATH=$HOME/.local .. $ make $ sudo make install

If a non-standard prefix is used (like /usr/local or $HOME/.local), the PYTHONPATH has to be tuned accordingly.

  • The _SourceXtractorPy is a generated python binding file and I think it should be found along the PYTHONPATH environment variable and therefore, it has to be installed together with the other non-binary python packages/modules.

If it is correctly installed (at the right location I mean) a "python - c "import _SourceXtractorPy" show work out of the box.

If it is not the case, could you please give me the full setup that you are using for the build? There might be a problem in that region in the install procedure of Elements.

Cheers,

		Hubert

System Engineer and Developer Phone: +41 22 379 21 93 Department of Astronomy, University of Geneva Fax : +41 22 379 21 33 Ch. d'Ecogia 16, CH-1290 Versoix

Le jeudi 09 décembre 2021 à 08:18 -0800, Marc Schefer a écrit :

I can't build the project at all using this method. I don't think it's supported maybe @degauden can confirm? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

degauden avatar Dec 09 '21 16:12 degauden

Nope, it doesn't work for me. When trying to build Elements

Make Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.

I'm not sure this is worth spending time on as we have a documented method of building that works...

marcschefer avatar Dec 10 '21 10:12 marcschefer

This warning is unrelated to the problem.

And I disagree: this is quite serious.

degauden avatar Dec 10 '21 10:12 degauden

Unless somebody has a solution to contribute, I don't think we'll solve this by next week and I don't think it's worth cancelling the release for it so I'm moving it to the next milestone.

marcschefer avatar Dec 10 '21 11:12 marcschefer