[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cross compiling gsl for arm cortex M4 (nrf52)
From: |
Julius Duin |
Subject: |
Re: cross compiling gsl for arm cortex M4 (nrf52) |
Date: |
Mon, 18 Sep 2023 17:31:40 +0200 |
Hello Mark,
thanks a lot for the quick response, I am not entirely sure if I already got
this right, after configuring with -I/crosscompilearea/gsl-2.7.1/include in c
flags I will still get the errors in make -> those are not include but rather
missing src file errors, e.g. undefined reference to `gsl_rng_get’
and many others like this. So including the path might let the compiler know
where it can find headers but the src code for some things still seems missing.
though, I went to the gsl_rng header file and the definition of the function
seems to be in the .h file anyways.
my configure command is now
./configure CC=/usr/local/gcc/bin/arm-none-eabi-gcc
CXX=/usr/local/gcc/bin/arm-none-eabi-gcc
LD=/usr/local/gcc/bin/arm-none-eabi-gcc AR=/usr/local/gcc/bin/arm-none-eabi-ar
OBJCOPY=/usr/local/gcc/bin/arm-none-eabi-objcopy
CFLAGS="-I/crosscompilearea/gsl-2.7.1/gsl -mthumb -march=armv7e-m
-mfpu=fpv4-sp-d16 -mfloat-abi=soft" CXXFLAGS="-mthumb -march=armv7e-m
-mfpu=fpv4-sp-d16 -mfloat-abi=soft" LDFLAGS="-I/crosscompilearea/gsl-2.7.1/gsl
--specs=nano.specs --specs=nosys.specs -mthumb -march=armv7e-m
-mfpu=fpv4-sp-d16 -mfloat-abi=soft"
C_INCLUDE_PATH=“/crosscompilearea/gsl-2.7.1/gsl" --target=arm-none-eabi
--host=arm-none-eabi
I also always make clean/distclean after every attempt so that nothing else can
go wrong.
If you need a more detailed description of my approach please get back to me.
Best
Julius
> On 18.09.2023, at 16:33, Mark Galassi <mark@galassi.org> wrote:
>
>
> Dear Julius,
>
> Your problem seems like it might have a straightforward solution. Whenever
> you do a lot of setting of CC and CXX and LD you might also want to set
> C_INCLUDE_PATH and CPLUS_INCLUDE_PATH (and maybe when you get to linking also
> LIBRARY_PATH).
>
> I would try finding the full path to the gsl_minmax.h file. Let's say it's
> in /mycrosscompilearea/stuff/include/gsl/gsl_minmax.h. Then, noting that
> what's being #included is gsl/gsl_minmax.h, and I would say something like
> C_INCLUDE_PATH=/mycrosscompilearea/stuff/include:$C_INCLUDE_PATH
>
> And the same for LDFLAGS and (if you use C++) for CPLUS_INCLUDE_PATH.
>
> You might also be able to put a -I option into the CFLAGS setting you are
> already using.
>
> And I would also investigate using pkg-config -- I have not used it in
> cross-compiling, so it might not work for you, but you can set your
> PKG_CONFIG_PATH to include /mycrosscompilearea/stuff/lib/wherever_gsl.pc_is
> and then use the usual:
>
> pkg-config gsl --cflags
> pkg-config gsl --libs
>
> Feel free to contact me further if you want to look at this together.