CarVac / librtprocess

A project to make RawTherapee's processing algorithms more readily available.
Other
52 stars 24 forks source link

fix installation on Linux. #21

Closed fcomida closed 5 years ago

fcomida commented 5 years ago

on 64 bits system libraries go to ${INSTALL_PREFIX}lib64

CarVac commented 5 years ago

Are you sure about this? The install prefix is /usr/ and in my /usr/ directory there isn't even any lib64 directory.

fcomida commented 5 years ago

I am on Fedora 29, my install prefix is "/usr/local" (where I put locally built software) and with my change librtprocess.so got intalled in "/usr/local/lib64/librtprocess.so". In Fedora 64 bits libraries are under "/usr/lib64" and "/lib64" is a symlink to "/usr/lib64". There is also "/usr/lib" and "/usr/local/lib" and symlinks as above for multilib (i686) packages.

Benitoite commented 5 years ago

Also note I've updated cmakelists.txt to include a mac part. I tested the merge on mac and this pr obliterates the change, installing into lib64, etc. If possible please sync with master again before merging it. Perhaps also make the UNIX parts you add conditional to be not APPLE so as to not apply on macOS.

Also, why not use the -DCMAKE_INSTALL_PREFIX or something to be more universal for those unixes?

fcomida commented 5 years ago

I also think INSTALL_PREFIX is somehow wrong. One should use CMAKE_INSTALL_PREFIX and there's no need to write it, for instance in the "install" directive DESTINATION is relative to CMAKE_INSTALL_PREFIX.

get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) should take care of finding out where libraries must be installed on each system.

heckflosse commented 5 years ago

@fcomida

I also think INSTALL_PREFIX is somehow wrong. One should use CMAKE_INSTALL_PREFIX and there's no need to write it, for instance in the "install" directive DESTINATION is relative to CMAKE_INSTALL_PREFIX.

I wrote that part to get it somehow working on Linux and msys2. Me being a complete cmake noob, @fcomida @CarVac feel free to change it to the best.

CarVac commented 5 years ago

Unfortunately I know even less about cmake so I can only defer to those who know better...

cryptomilk commented 5 years ago

I'm sorry but this is the wrong way to do it. Please use the GNUInstallDirs module provided by cmake:

See: https://git.cryptomilk.org/projects/cmocka.git/tree/CMakeLists.txt#n34 and https://git.cryptomilk.org/projects/cmocka.git/tree/src/CMakeLists.txt#n75

butcherg commented 5 years ago

I started #27, I'm too stupid to associate "fix installation on Linux" with the install target...

Here is the GNU standard directory policy: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html

I think it's important to respect this policy especially, well, as of my last investigation of the subject, cmake doesn't include 'uninstall' targets in its Makefiles...

cryptomilk commented 5 years ago

That's why cmake offers a GNUInstallDir module ...

CarVac commented 5 years ago

I attempted to make it use GNUInstallDirs but now Filmulator can't find the .so file (it does compile though).

Things installed:

Here's my current CMakeLists.txt.

Any advice?

butcherg commented 5 years ago

You need to add /user/local/lib to the library search path. On Ubuntu, I:

  1. made (or found?) a file in /etc/ld.so.conf.d/ named libc.conf; mine now looks like this:
    # libc default configuration
    /usr/local/lib

    And then: $ sudo ldconfig

CarVac commented 5 years ago

How strange that libc.conf has been there since... 2009 according to the filesystem, yet I needed to run ldconfig to get it to recognize that?

In any case, I've pushed my attempt to the dev branch so I'd appreciate it if people could try it.

butcherg commented 5 years ago

My file was there, but empty. I had to put /usr/local/lib line in and run ldconfig

cryptomilk commented 5 years ago

@CarVac this doesn't point to cmake changes.

Floessie commented 5 years ago

@CarVac

Here's my current CMakeLists.txt. Any advice?

Don't use file(GLOB_RECURSE SOURCES "src/*.cc"). The reason is in the CMake docs:

Note: We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.

Best, Flössie

heckflosse commented 5 years ago

@Floessie

Don't use file(GLOB_RECURSE SOURCES "src/*.cc")

It was me who used that, not knowing anything about cmake

cryptomilk commented 5 years ago

I'm travelling this week and attend devconf. I can take a look and improve cmake next week.

Floessie commented 5 years ago

@heckflosse

It was me who used that, not knowing anything about cmake

It just caught my eye. Sometimes it's more important to get started quickly. But I'm really curious what Andreas will come up with...

Best, Flössie

cryptomilk commented 5 years ago

See PR #37