Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added LIB_INSTALL_DIR to correct libs install on 64-bit systems #636

Merged
merged 2 commits into from
Sep 8, 2017
Merged

Added LIB_INSTALL_DIR to correct libs install on 64-bit systems #636

merged 2 commits into from
Sep 8, 2017

Conversation

Vascom
Copy link
Collaborator

@Vascom Vascom commented Sep 8, 2017

Solve for #633

@xor-gate
Copy link
Member

xor-gate commented Sep 8, 2017

This looks good, but it should autodetect lib and lib64. We probably need to implement the solution which is on the cmake mailinglist here: https://cmake.org/pipermail/cmake/2013-July/055374.html

@Vascom
Copy link
Collaborator Author

Vascom commented Sep 8, 2017

This not should autodetect lib and lib64. It set by external parameter:
cmake .. -DLIB_INSTALL_DIR:PATH=/usr/lib64

@xor-gate
Copy link
Member

xor-gate commented Sep 8, 2017

That is not true autodetection, that is passed by the developer which builds the package. CMake should be able to autodetect it if the default libdir is lib64. I'm not against adding build parameters but the idea would be good by default.

@Vascom
Copy link
Collaborator Author

Vascom commented Sep 8, 2017

Fedora has /usr/lib and /usr/lib64 simultaneously and you can't autodetect where I want place builded libs. Let maintainer do it via -DLIB_INSTALL_DIR:PATH= .

@xor-gate
Copy link
Member

xor-gate commented Sep 8, 2017

Yeah the lib contains 32 bit stuff which can run with the 32bit compatibility layer under
64 bit kernels. But the default detected path should be lib64 because the system booted an amd64 or arm64 kernel anyway.

@Vascom
Copy link
Collaborator Author

Vascom commented Sep 8, 2017

You can add autodetect if you wish but keep force redefinition of it by this parameter.

@xor-gate
Copy link
Member

xor-gate commented Sep 8, 2017

Yes that would be fine, but please document the addition of this supported build parameter in doc/compiling.doc

@Vascom
Copy link
Collaborator Author

Vascom commented Sep 8, 2017

This is enough?

@xor-gate
Copy link
Member

xor-gate commented Sep 8, 2017

Great, thanks for this. The name LIB_INSTALL_DIR comes from autoconf GNU projects, but I can live with this as it is convenient for everybody.

@xor-gate xor-gate merged commit 1700e6a into stlink-org:master Sep 8, 2017
@Vascom
Copy link
Collaborator Author

Vascom commented Sep 8, 2017

Thanks.
I don't know where it from but it used in %cmake macro for building Fedora packages:

  /usr/bin/cmake \
        -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
        -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
        -DLIB_INSTALL_DIR:PATH=/usr/lib64 \
        -DSYSCONF_INSTALL_DIR:PATH=/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
%if "lib64" == "lib64" 
        -DLIB_SUFFIX=64 \
%endif 
        -DBUILD_SHARED_LIBS:BOOL=ON

@xor-gate
Copy link
Member

xor-gate commented Sep 8, 2017

It also adds the -DLIB_SUFFIX=64 build parameter which seems it uses the solution from the CMake mailing list. The LIB_SUFFIX is probably not supported currently in stlink. I think still we need to implement the solution from the mailing list as I see the fedora specfile to build the RPM as it uses the "lib64" conditional and no /usr/lib64 is hardcoded.

@Vascom
Copy link
Collaborator Author

Vascom commented Sep 8, 2017

But -DLIB_SUFFIX is the same external parameter as -DLIB_INSTALL_DIR.

@Vascom Vascom deleted the patch-2 branch September 8, 2017 12:09
@Nightwalker-87 Nightwalker-87 added this to the v1.5.0 milestone Feb 23, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On 64-bit system libs installed to /usr/lib instead of /usr/lib64.
3 participants