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

nad2bin being run while building prevents cross compiling #1235

Closed
3nids opened this issue Jan 23, 2019 · 13 comments
Closed

nad2bin being run while building prevents cross compiling #1235

3nids opened this issue Jan 23, 2019 · 13 comments

Comments

@3nids
Copy link

3nids commented Jan 23, 2019

I am trying to compile Proj 5.2 for Android and I am facing this error:

image

It tries to run nad2bin on the environnement, but nad2bin has been compiled for Android.

What is the proper approach?
I am using autotools, but I failed to disable building nad2bin (is it possible?). But is it the right approach?

@3nids
Copy link
Author

3nids commented Jan 23, 2019

and if I try with cmake, here is the issue I have
image
although I tried to disable the tests:
cmake -DCMAKE_INSTALL_PREFIX:PATH=$STAGE_PATH -DBUILD_GTEST=OFF -DPROJ_TESTS=OFF -DBUILD_NAD2BIN=OFF $BUILD_proj

@kbevers
Copy link
Member

kbevers commented Jan 23, 2019

I haven't got an answer to your question. But I have a counter-question to my fellow PROJ developers: Do we still have a need for nad2bin? We have moved all grids, except null, to https://github.com/OSGeo/proj-datumgrid where we manage the grids in binary form. I can't see why we would stille keep it around except for building null from null.lla but we can get around that by just distributing the null grid in binary form.

@rouault @sebastic thoughts?

@sebastic
Copy link
Contributor

nad2bin is required to convert the .lla sources, this is part of the proj-datumgrid build process. I strongly object to keeping only the binaries and removing nad2bin. The .lla files are the preferred form for modification.

The Debian package for PROJ 5.2 builds fine on arm*, including tests.

This issue doesn't have enough information to determine what causes the issue. It may be a cross-compilation issue.

@kbevers
Copy link
Member

kbevers commented Jan 23, 2019

nad2bin is required to convert the .lla sources, this is part of the proj-datumgrid build process.

We can move nad2bin to proj-datumgrid. I feel like it has served it's purpose as part of the main PROJ package now that all the *.lla files have moved elsewhere.

@3nids
Copy link
Author

3nids commented Jan 23, 2019

@sebastic I'd be happy to provide more info, what would you need? Or do you have a reference to a script that build on arm? cheers!

@rouault
Copy link
Member

rouault commented Jan 23, 2019

@sebastic It compiles on ARM in the Debian case. Not cross-compilation ?

I can indeed see that nad/Makefile.am assumes to be able to run the nad2bin executable that it has compiled, which can be problematic with cross-compilation indeed. But I don't see why it would have worked better in 4.9 as you mentionned in your email @3nids . Maybe you need to tweak nad/Makfile.am to run a nad2bin executable of the architecture on which you build on.

@sebastic
Copy link
Contributor

sebastic commented Jan 23, 2019

We can move nad2bin to proj-datumgrid. I feel like it has served it's purpose as part of the main PROJ package now that all the *.lla files have moved elsewhere.

In my opinion it belongs in the PROJ source tree. No need to complicate the proj-datumgrid project by having to build C programs.

@sebastic I'd be happy to provide more info, what would you need?

Details about your build environment & full build logs for starters.

Or do you have a reference to a script that build on arm?

See the Debian package sources.

It compiles on ARM in the Debian case. Not cross-compilation ?

On, build and target architectures are the same. There are arm64 build daemons that also build armhf packages.

@3nids
Copy link
Author

3nids commented Jan 24, 2019

Maybe asking this differently, is there a way to use the cmake option BUILD_NAD2BIN=OFF with autotools?
I tried --without-nad2bin and --disable-nad2bin without success.

@rouault
Copy link
Member

rouault commented Jan 24, 2019

Maybe asking this differently, is there a way to use the cmake option BUILD_NAD2BIN=OFF with autotools?
I tried --without-nad2bin and --disable-nad2bin without success.

No, you'll have to hack into nad/Makefile.am to disable the use of nad2bin

@3nids
Copy link
Author

3nids commented Jan 29, 2019

Thanks @rouault
I gave it a try but changing the Makefile requires having automake-1.16 and I am running this on xenial where it is not available....I might wait for this to land in master! Thanks again

@rouault
Copy link
Member

rouault commented Jan 29, 2019

I gave it a try but changing the Makefile requires having automake-1.16 and I am running this on xenial where it is not available...

I'm running Xenial too. No problem for me with hacking Makefile.am. You probably just need to run ./autogen.sh

@ndarilek
Copy link

Any chance this might land in a release soon? I just encountered it myself under the exact same circumstances--attempting to cross-compile from Ubuntu to Android.

Thanks!

@QuLogic
Copy link
Contributor

QuLogic commented Feb 15, 2019

See #1267.

rickystewart added a commit to cockroachdb/PROJ that referenced this issue Jun 15, 2021
This breaks cross-compiled Bazel builds due to
OSGeo#1235. We appear to never need
`nad2bin`, so we can safely just exclude this entire directory.
rickystewart added a commit to rickystewart/cockroach that referenced this issue Jun 15, 2021
We need to teach `bazci` about the configurations and add a new script
to support this. Also run both the Linux cross job and the Windows cross
job with `-c opt`, so we can start getting optimized builds.

Also add a small hack to `proj` to work around
OSGeo/PROJ#1235.

Closes cockroachdb#66208
Closes cockroachdb#66209

Release note: None
craig bot pushed a commit to cockroachdb/cockroach that referenced this issue Jun 16, 2021
66455: build: add script for cross-compilation job to windows via bazel r=rail a=rickystewart

We need to teach `bazci` about the configurations and add a new script
to support this. Also run both the Linux cross job and the Windows cross
job with `-c opt`, so we can start getting optimized builds.

Also add a small hack to `proj` to work around
OSGeo/PROJ#1235.

Closes #66208
Closes #66209

Release note: None

66498: roachprod: update to recommended ubuntu focal image r=rail a=rickystewart

The previous version was deprecated -- see #66183 for context.

Release note: None

Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
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

6 participants