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

Rules for compiling C files are ignored for lua compilation #11

Open
pfebrer opened this issue Nov 29, 2023 · 2 comments
Open

Rules for compiling C files are ignored for lua compilation #11

pfebrer opened this issue Nov 29, 2023 · 2 comments

Comments

@pfebrer
Copy link

pfebrer commented Nov 29, 2023

If you setup setup.make with a recipe for .c.o:

PLATFORM=linux
FC = gfortran
CC = fake_cc
#
.f90.o:
        $(FC) -c $(FFLAGS) $(INC) $<
.F90.o:
        $(FC) -c $(FFLAGS) $(INC) $<
.c.o:
        whatever $<

You will notice that lua compilation ignores this recipe and CC and instead compiles with gcc and some flags that you have not set.

setup.make:8: warning: overriding recipe for target '.f90.o'
setup.make:8: warning: ignoring old recipe for target '.f90.o'
setup.make:10: warning: overriding recipe for target '.F90.o'
setup.make:10: warning: ignoring old recipe for target '.F90.o'
setup.make:12: warning: overriding recipe for target '.c.o'
setup.make:12: warning: ignoring old recipe for target '.c.o'
(mkdir -p aotus/obj ; cd aotus/obj ; \
	echo "TOP_DIR =../.././aotus" > Makefile ; \
	echo "PLATFORM = linux" >> Makefile ; \
	echo "include ../.././aotus/Makefile.smeka" >> Makefile )
(cd aotus/obj ; make SETUP=../../setup.make )
make[1]: Entering directory '/home/pfebrer/Simulations/siesta/siesta-feedstock/build_artifacts/siesta_1701213319742/work/obj_cmake/External/Lua-Engine/flook-prefix/src/flook-build/aotus/obj'
mkdir -p external
cp -rf ../.././aotus/external/lua-5.3.5 external/
make -C external/lua-5.3.5 linux
make[2]: Entering directory '/home/pfebrer/Simulations/siesta/siesta-feedstock/build_artifacts/siesta_1701213319742/work/obj_cmake/External/Lua-Engine/flook-prefix/src/flook-build/aotus/obj/external/lua-5.3.5'
cd src && make linux
make[3]: Entering directory '/home/pfebrer/Simulations/siesta/siesta-feedstock/build_artifacts/siesta_1701213319742/work/obj_cmake/External/Lua-Engine/flook-prefix/src/flook-build/aotus/obj/external/lua-5.3.5/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[4]: Entering directory '/home/pfebrer/Simulations/siesta/siesta-feedstock/build_artifacts/siesta_1701213319742/work/obj_cmake/External/Lua-Engine/flook-prefix/src/flook-build/aotus/obj/external/lua-5.3.5/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lapi.o lapi.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lcode.o lcode.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lctype.o lctype.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ldebug.o ldebug.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ldo.o ldo.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ldump.o ldump.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lfunc.o lfunc.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lgc.o lgc.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o llex.o llex.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lmem.o lmem.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lobject.o lobject.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lopcodes.o lopcodes.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lparser.o lparser.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lstate.o lstate.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lstring.o lstring.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ltable.o ltable.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ltm.o ltm.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lundump.o lundump.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lvm.o lvm.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lzio.o lzio.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lauxlib.o lauxlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lbaselib.o lbaselib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lbitlib.o lbitlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lcorolib.o lcorolib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ldblib.o ldblib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o liolib.o liolib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lmathlib.o lmathlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o loslib.o loslib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lstrlib.o lstrlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o ltablib.o ltablib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lutf8lib.o lutf8lib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o loadlib.o loadlib.c
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o linit.o linit.c

This is because the file generated at aotus/external/lua-5.3.5/src/Makefile sets CC to gcc -std=gnu99 and sets the recipes for compiling the files, ignoring whatever was set in setup.make.

Found in conda-forge/siesta-feedstock#50

@zerothi
Copy link
Contributor

zerothi commented Nov 29, 2023

Agreed, the lua compilation is a bit odd and requires some adaptation. However, it becomes a bit tedious when we need to upgrade the lua versions.

I am not fully sure how to compile aotus without the shipped with lua, that could be tested locally (to check work-arounds).

@zerothi
Copy link
Contributor

zerothi commented Nov 29, 2023

aotus has since my last check moved to github (https://github.com/apes-suite/aotus/tree/branch/default). I'll have to update the code shipped in flook, and upgrade smeka to customize details a bit.
Sorry, but this is rather low priority for me as of now.

What can be done right now is cd into aotus/external/lua-5.3.5 and do make CC=... which will actually work.

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

2 participants