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

32-bit build failure #221

Open
AdrianBunk opened this issue Jan 14, 2025 · 10 comments
Open

32-bit build failure #221

AdrianBunk opened this issue Jan 14, 2025 · 10 comments
Assignees

Comments

@AdrianBunk
Copy link

https://buildd.debian.org/status/fetch.php?pkg=cppad&arch=armhf&ver=2025.00.00.0-1&stamp=1736795682&raw=0

In file included from /build/reproducible-path/cppad-2025.00.00.0/include/cppad/core/ad.hpp:17,
                 from /build/reproducible-path/cppad-2025.00.00.0/include/cppad/cppad.hpp:45,
                 from /build/reproducible-path/cppad-2025.00.00.0/test_more/debug_rel/debug.cpp:5:
/build/reproducible-path/cppad-2025.00.00.0/include/cppad/local/play/player.hpp:700:9: error: ‘void CppAD::local::player<Base>::setup_random(size_t&)’ cannot be overloaded with ‘void CppAD::local::player<Base>::setup_random(unsigned int&)’
  700 |    void setup_random(size_t& not_used)
      |         ^~~~~~~~~~~~
/build/reproducible-path/cppad-2025.00.00.0/include/cppad/local/play/player.hpp:690:9: note: previous declaration ‘void CppAD::local::player<Base>::setup_random(unsigned int&)’
  690 |    void setup_random(unsigned int& not_used)
      |         ^~~~~~~~~~~~

size_t is unsigned int on 32-bit architectures.

@bradbell I suspect this is caused by commit e52559d.

@bradbell
Copy link
Contributor

It appears that github actions no longer support 32-bit machines; see
https://dev.to/drhyde/automatic-cross-platform-testing-part-6-32-bit-linux-fh2#comment-25ihc

Do you know of a way to get the cppad gitub actions to test a 32 bit machine ?

@bradbell
Copy link
Contributor

bradbell commented Jan 16, 2025

I tried to create a container for this case using to docker library i686/ubuntu; see
https://forums.docker.com/t/support-for-32-bit-images-containers-on-64-bit-hosts/10010

The version of cmake was so old that I installed cmake-3.5 using section B of
https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line

But that did not help because the version of g++ is so old that C++11 support it is only experimental:
g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.

Do you know of a newer 32-bit docker container I can use for testing ?

@bradbell bradbell self-assigned this Jan 16, 2025
@barak
Copy link

barak commented Jan 16, 2025

I'm packaging CppAD for Debian, so I'm also interested in getting this resolved.

@bradbell
One way to get a 32-bit build environment would be to make an account on salsa.debian.org (which is Debian's gitlab instance) and use a repo there, turn on automatic building (CI) for specific architectures. Like i686 or x32 or arm32 or whatever. You should also be able to make a 32-bit chroot on a standard amd64 linux machine. Or even just install cross-compilation tools to make "gcc -m32" work and do it in place without any tricky virtual whatnots, by telling it to use the right compilation tools.

@bradbell
Copy link
Contributor

bradbell commented Jan 16, 2025

@barak Thanks for the suggestion. I tried the -m32 approach, but ran into a problem (on my machine); see
https://discussion.fedoraproject.org/t/32-bit-stdlibc-conflicts-with-64bit/123280/11

The same approach inside a ubuntu container worked and gave similar errors to above:

[  1%] Building CXX object speed/src/CMakeFiles/speed_src.dir/link_det_lu.cpp.o
In file included from /work/cppad.git/speed/src/link_det_lu.cpp:6:
/work/cppad.git/include/cppad/utility/vector.hpp:182:4: error: 'CppAD::vector<Type>::vector(unsigned int)' cannot be overloaded with 'CppAD::vector<Type>::vector(size_t)'
  182 |    vector(unsigned int n) : capacity_(0), length_(0), data_(nullptr)
      |    ^~~~~~
...

@bradbell
Copy link
Contributor

As it turned out the -m32 flag problem was a problem with my system and has been fixed. This makes it easier to test before future commits.

@bradbell
Copy link
Contributor

bradbell commented Jan 18, 2025

@barak I added the -m32 option to the CppAD cmake command; see -m32 on
https://cppad.readthedocs.io/latest/cmake.html#m32
and 01-17 on
https://cppad.readthedocs.io/latest/2025.html#mm-dd-01-17
Thanks

@AdrianBunk I think your bug was fixed by the change to player.hpp in
d00cd6a
Please test the stable/2025 branch on your system.
If it works for you, I plan to make a new release corresponding to the current state of that branch.

@bradbell
Copy link
Contributor

bradbell commented Jan 18, 2025

I made the same changes as in stable/2025 using the cppad fedora spec file and the build results went from
https://koji.fedoraproject.org/koji/taskinfo?taskID=127877406
to
https://koji.fedoraproject.org/koji/taskinfo?taskID=128068795

So I am confident that this has fixed the problem and will create the new release.

@bradbell
Copy link
Contributor

bradbell commented Jan 19, 2025

The new release is now linked to the documentation for both the stable and latest versions: see Versions on
https://cppad.readthedocs.io/stable-2025/#versions

@AdrianBunk Please close this issue if the new release works for you.

@bradbell
Copy link
Contributor

bradbell commented Jan 20, 2025

@barak It appears from the link below that you were having the same problem:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093006

Feel free to reopen this issue and leave a comment if the following release does not fix it for you
https://github.com/coin-or/CppAD/releases/tag/20250000.1

@barak
Copy link

barak commented Jan 22, 2025

Debian bug 1093006 is indeed fixed by 20250000.1:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants