Compile with `--prefix` doesn't work
I am using conda to build and install xbasic. However when I build with ./configure --prefix=/path/to/conda, make fails to recognize this and will error out because it can't find the readline headers:
do_gets.c:22:10: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
The issue where this occurs is at https://github.com/conda-forge/staged-recipes/pull/8509
Note that I think this is because the custom CFLAGS variable in the environment prior to the build is not being respected by the build system here
I have not heard about conda-forge so far. Let me check....
It can well be, that the CFLAGS from the environment is ignored. So this would be a mater of the Makefile. At the moment I have no clue...
Try following:
In Makefile.in:line 66
CFLAGS= @CFLAGS@ $(INC) $(DEF) $(OPT) $(REGS)
Maybe another line in the Makefile should be modified. I have attached a modified Makefile.in. I am not sure if this solves the issue. Need someone to test this. a.zip
Progress! Now it just fails to link against readline:
$BUILD_PREFIX/bin/x86_64-conda_cos6-linux-gnu-cc -fPIC -shared -Wl,-Bsymbolic-functions -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I$PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/x11basic-1.26 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -DUSE_X11 -O3 -fno-omit-frame-pointer -Wl,-soname,libx11basic.so.1.26 -o libx11basic.so.1.26 xbasic.c tools.c loadprg.c file.c io.c io_basic.c parser.c variablen.c svariablen.c array.c parameter.c fft.c mathematics.c memory.c runtime.c wort_sep.c ltext.c functions.c sfunctions.c afunctions.c kommandos.c gkommandos.c bitmap.c do_gets.c errortxt.c window.c sysVstuff.c aes.c graphics.c sound.c number.c decode.c virtual-machine.c type.c lodepng.c md5.c sha1.c -ldl -lm -lpthread -lutil -lreadline
/home/scopatz/miniconda/conda-bld/x11basic_1559832336691/_build_env/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
make: *** [Makefile:402: libx11basic.so.1.26] Error 1
OK, here is a next try a.zip
I am now getting a lot further in the compilation, but now back to seeing:
do_gets.c:22:10: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Here is a gist with the build output
Yes, thanks, this is useful information, however, as far as I can see, readline is not the only package missing, e.g. lapack, and even X11 (X.org). The corresponding -dev packages need to be installed before trying to compile,e.g. sudo apt-get install libreadline-dev, Xorg-dev, liblapack-dev etc... At least on a normal Ubuntu one would do this.
Are you sure, that the intermediate state (where it compiled but not linked) was really successfull? Maybe you have not redone the ./configure after placing a new Makefile.in. If you just type make (after having touched the Makefile.in), a prefix of /usr/bin is used.
Is this still an issue, or can this be closed?