Closed luau-project closed 2 months ago
Hello. Yesterday, I noticed that the generated pkg-config files for single precision and long-double precision had an incorrect Cflags attribute, as you can see in the last picture of my post above, because:
-D__cminpack_float__
;-D__cminpack_long_double__
.cd /tmp
git clone --branch=fix-pkg-config https://github.com/luau-project/cminpack.git cminpack-fork-updated
mkdir fork-updated-v1.3.9
cd fork-updated-v1.3.9/
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DUSE_BLAS=OFF --install-prefix $PWD/static-updated -S ../cminpack-fork-updated/ -B _static-updated
cmake --build _static-updated/ --config Release
ctest --test-dir _static-updated/ -C Release
cmake --install _static-updated/ --config Release
cat static-updated/lib/pkgconfig/cminpack_s.pc
) has the same behavior as earlier, because they were correct:
cat static-updated/lib/pkgconfig/cminpacks_s.pc
) and (cat static-updated/lib/pkgconfig/cminpackld_s.pc
):
Nice! Can you please confirm that double-precision shared minpack will be unaffected by this? My fear is that some dependencies may depend on this, so we shouldn't change the package name (cminpack.pc).
Hello @devernay .
I saw that there were many commits in the last few days, and I will need some time to understand what happened.
Hello @jschueller .
I saw that you asked a few questions about chunks of scripts on the CMakeLissts.txt file. If you follow the diff, you can see that I didn't change many things, I mostly moved things to different places, trying to preserve the maximum amount of work that was done by the people who implemented this CMake script in the past.
In short, I agree with you that the current CMake script is a bit confuse, but it was just derived from past work.
In my honest opinion, I think the CMakeLists.txt script should be reworked from scratch, because it is hard to maintain and to add features.
I'll work on a complete rewrite of the CMake build in my fork. However, this will not happen for now.
my changes were simply fixing BLAS support in the code
Should we close this one in favor of #71 ?
Should we close this one in favor of #71 ?
In my view, yes. #71 seems better.
Description
Right after cminpack v1.3.9 was released, I opened a pull request on MSYS2 to insert cminpack on their repositories https://github.com/msys2/MINGW-packages/pull/21025. During the review process, the reviewer gave some valuable inputs:
_s
suffix to the library name. The reviewer noticed that the generated pkg-config files (*.pc) didn't match well the generated static library files. Investigating further, I noticed that all the installed .pc files had a wrong link flag (-lThus, this pull request addresses the second point above and fixes the installed .pc files.
Issue reproduction
The current released version (v1.3.9.tar.gz)
To have a clear understand of what is happening in the actual version of cminpack (v1.3.9), I prepared a simple script to be run on Debian-based distros (Debian 12 stable, Ubuntu 22.04 +, etc).
Install the tooling:
Build, test and install the static version of cminpack v1.3.9 from the released tarball
cat static/lib/pkgconfig/cminpack.pc
the installed pkg-config file for the double-precision version, you get the following screen:-lcminpack
, but the file is shown as/tmp/build-v1.3.9/static/lib/pkgconfig/libcminpack_s.a
, which is an issue;The fixed version on my fork
cat static/lib/pkgconfig/cminpack_s.pc
the installed pkg-config file for the double-precision version, you get the following screen:-lcminpack_s
, which is correct compared to the file shown/tmp/build-v1.3.9/static/lib/pkgconfig/libcminpack_s.a
;How
CMAKE_RELEASE_POSTFIX
. I changed the way how it works in the CMakeLists.txt and propagated all the changes down to tests on examples/CMakeLists.txt;Conclusion
I tested locally the shared and static versions. In my view, everything is working as expected now.