(CHICKEN) Could not install iup Eggs via the terminal - chicken-scheme

I tried to compile a scheme file with CHICKEN and it says there that I need to install the iup port of CHICKEN. So I went to the website and tried to install the iup port but I got an error. Then I realized I need to get ffcall. I got that installed and tried to install the iup port again. And failed.
I don't know if I got srfi-42 installed on my system. Even if I know it's not installed I still don't know how to install srfi-42 to get the iup port to work.
This is the error that I get:
ander#Ander:~/blah/chicken-4.11.0/chicken-4.11.0$ sudo chicken-install iup
retrieving ...
connecting to host "chicken.kitten-technologies.co.uk", port 80 ...
requesting "/henrietta.cgi?name=iup&mode=default" ...
reading response ...
HTTP/1.1 200 OK
Date: Sat, 12 Nov 2016 06:16:26 GMT
Server: Apache/2.2.31 (Unix) DAV/2 PHP/5.5.36 mod_fastcgi/2.4.6
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain
reading chunks ....
reading files ...
./iup-controls.scm
./iup-base.scm
./iup-config.scm
./iup-glcanvas.scm
./iup-dialogs.scm
./iup-dynamic.scm
./iup-glcontrols.scm
./iup-mglplot.scm
./iup-ole.scm
./iup-plot.scm
./iup-pplot.scm
./iup-scintilla.scm
./iup-types.scm
./iup-web.scm
./iup.meta
./iup.release-info
./iup.scm
./iup.setup
iup located at /tmp/temp5d54.6346/iup
checking platform for `iup' ...
checking dependencies for `iup' ...
install order:
("iup")
installing iup:1.8.0 ...
changing current directory to /tmp/temp5d54.6346/iup
'/usr/local/bin/csi' -bnq -setup-mode -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"iup\" \"1.8.0\"))" 'iup.setup'
'/usr/local/bin/csc' -feature compiling-extension -setup-mode -s -O2 -d1 iup.scm -j iup -j iup-base -j iup-controls -j iup-dialogs -j iup-glcanvas -j iup-glcontrols -j iup-plot -j iup-mglplot -j iup-pplot -j iup-scintilla -j iup-web -j iup-config -lcallback -liup -liupim -liupimglib -liupcontrols -liupmatrixex -liupgl -liupglcontrols -liup_plot -liup_mglplot -liup_pplot -liup_scintilla -liupweb
iup.c:17:16: fatal error: im.h: No such file or directory
compilation terminated.
Error: shell command terminated with non-zero exit status 256: 'gcc' 'iup.c' -o 'iup.o' -c -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -fPIC -DPIC -DC_SHARED -I/usr/local/include/chicken
Error: shell command failed with nonzero exit status 256:
'/usr/local/bin/csc' -feature compiling-extension -setup-mode -s -O2 -d1 iup.scm -j iup -j iup-base -j iup-controls -j iup-dialogs -j iup-glcanvas -j iup-glcontrols -j iup-plot -j iup-mglplot -j iup-pplot -j iup-scintilla -j iup-web -j iup-config -lcallback -liup -liupim -liupimglib -liupcontrols -liupmatrixex -liupgl -liupglcontrols -liup_plot -liup_mglplot -liup_pplot -liup_scintilla -liupweb
Error: shell command terminated with nonzero exit code
17920
"'/usr/local/bin/csi' -bnq -setup-mode -e \"(require-library setup-api)\" -e \"(...
I know it's pretty long but the error pops up just about at the end of the heap of output above.

The real error here is iup.c:17:16: fatal error: im.h: No such file or directory, which is actually the C compiler complaining.
This error means either you don't have the development package for iup installed (system headers), or the C compiler cannot find the header files because it's in a nonstandard location. If it's the latter, you can try CSC_OPTIONS=-I/path/to/include chicken-install iup
Unfortunately, IUP itself is known to be a real pain to install, mostly because very few distros have packages for it. What you didn't say in your message is why exactly you need iup. Is this some kind of program you're trying to install, which uses CHICKEN plus IUP?

Related

OpenCOBOL Static Linking Multiple .cob Files

I am trying to statically link two COBOL files together using GnuCobol (Windows 10) following the example listed here: https://open-cobol.sourceforge.io/historical/open-cobol/Static-Linking.html but cannot seem to get it to work.
I am running the following:
cobc -free -c InterpFunc.cob
cobc -free -c -fmain Integrator.cob
cobc -x -o .\\dist\\integrator Integrator.o InterpFunc.o
The '.o' files compile correctly, but the binary never builds with the following errors:
H:\Programs\COBAL\cobc\bin\cobc.exe: unrecognized option '-fmain'
h:/programs/cobal/cobc/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain#16'
collect2.exe: error: ld returned 1 exit status
The terminal process terminated with exit code: 1
I have tried a few different things such as leaving out the '-fmain' or leaving out the '-x', but all seem to produce different errors.
Is this perhaps an issue with my compiler/system setup or am I misunderstanding how to statically link files?
I'm quite sure you do not use a compiler matching that old documentation (having "historical" in its URL). I'm quite sure it'll work the way the current manual says:
The easiest way of combining multiple files is to compile them into a single executable.
One way is to compile all the files in one command:
$ cobc -x -o prog main.cob subr1.cob subr2.cob
Another way is to compile each file with the option -c, and link them at the end. > The top-level program must be compiled with the option -x.
$ cobc -c subr1.cob
$ cobc -c subr2.cob
$ cobc -c -x main.cob
$ cobc -x -o prog main.o subr1.o subr2.o

Cross compiling Openssl with the x86_64-linux-gnu-gcc compiler on a Fedora 29 host

I am trying to cross compile openssl using the x86_64-linux-gnu-gcc on a Fedora 29 host.
I am getting this error:
cryptlib.h:62:11: fatal error: stdlib.h: No such file or directory
The compile command is:
x86_64-linux-gnu-gcc -o cryptlib.o cryptlib.c
As I understand it, the compiler should find stdlib.h in it's standard path since it has been included with <..>.
I tried testing for it using the pre processor, which said that it can't find it.
echo '#include <stdlib.h>' | x86_64-linux-gnu-cpp -H -o /dev/null
:1:10: fatal error: stdlib.h: No such file or directory
I tested for another header file, it it was able to find it.
echo '#include <stdbool.h>' | x86_64-linux-gnu-cpp -H -o /dev/null
. /usr/lib/gcc/x86_64-linux-gnu/8/include/stdbool.h
Has anyone come across this issue ?.
Regards
Chandana

Makefile max load on remote server

we have a huge project with very time consuming sub-tasks running on Unix. The whole make process runs multiple hours. So building in parallel is essential for us. The expensive jobs are preformed on a remote server via ssh. Everything works fine. But I'm afraid that accidentally a team member could forget to specify the number for the -j flag. The --load-average flag uses the load on the local server so no matter how busy the remote server is it would generate hundreds of sub-tasks on the remote server which would slow down the entire company. Please note that I don't have admin rights on either server. We could also live with limiting the number of jobs (hardcoded).
Thanks a lot in Advance
Karl
If you have GNU make 4.2 or better, you can check that the user didn't give a raw -j by looking at MAKEFLAGS:
ifeq (-j,$(filter -j,$(MAKEFLAGS)))
$(error You cannot use -j without specifying a number of jobs)
endif
If you have an earlier version of GNU make you can do this by checking if both -j was given AND the jobserver is active:
ifneq (,$(filter -j,$(MAKEFLAGS)))
ifneq (,$(filter --jobserver-%,$(MAKEFLAGS)))
$(error You cannot use -j without specifying a number of jobs)
endif
endif
(this version will work for newer versions as well).
It's possible this won't work with versions of GNU make <4.0; I didn't test it.
For older make versions you can consider the following. That is not pure makefile way, but works.
Solution
ifneq (0,$(shell ps --pid $$PPID -o args= | grep --perl-regexp -c '^make.*-j(?!\s*[0-9]+\b)'))
$(error You cannot use -j without specifying a number of jobs)
endif
# Or oneliner:
#$(if $(shell ps --pid $$PPID -o args= | grep --perl-regexp -c '^make.*-j(?!\s*[0-9]+\b)' | grep -v '^0$$'),$(error You cannot use -j without specifying a number of jobs))
# Below part just for testing
all a 1: ; #exit 0
Testing
$ make
$ make a
$ make 1
$ make -j1
$ make -j1 a
$ make -j1 1
$ make -j 1
$ make -j 1a
Makefile:6: *** You cannot use -j without specifying a number of jobs. Stop.
$ make -j a
Makefile:6: *** You cannot use -j without specifying a number of jobs. Stop.
$ make a -j
Makefile:6: *** You cannot use -j without specifying a number of jobs. Stop.
$ make 1 -j a
Makefile:2: *** You cannot use -j without specifying a number of jobs. Stop.
How it works
It is taking information from parent process (that is make process) using ps utility, and later filter out arguments using grep (regular expression is more or less: find make command with -j parameter that is not followed by a number).
Based on to the answer from Kuchara above I needed the following enhancement, since I call some subsystems with:
$(MAKE) $(MFLAGS) ...
and this will add the jobserver and remove the number from the -j flag in the subsystem:
yy:
#echo yy mflags: $(MFLAGS)
#echo yy ps: $(shell ps --pid $$PPID -o args=)
$(MAKE) $(MFLAGS) zz
zz:
#echo zz mflags: $(MFLAGS)
#echo zz ps: $(shell ps --pid $$PPID -o args=)
Testing:
make -j 3 yy
yy mflags: - --jobserver-fds=3,4 -j
yy ps: make -j 3 yy
zz mflags: -w --jobserver-fds=3,4 - --jobserver-fds=3,4 -j
zz ps: make - --jobserver-fds=3,4 -j zz
I needed to combine the answers from MadScientist and Kuchara:
ifneq (0,$(shell ps --pid $$PPID -o args= | grep --perl-regexp -c '^make.*-j(?!\s*[0-9]+\b)'))
ifeq (0,$(shell ps --pid $$PPID -o args= | grep --perl-regexp -c '^make.*--jobserver'))
$(error You cannot use -j without specifying a number of jobs)
endif
endif
Thanks a lot again at both for your great ideas.

mosquitto_pub Error: '-l' mode not available threading support has not been compiled in

When trying to publish a message to a topic using the mosquitto_pub -l flag, I get the error:
Error: '-l' mode not available, threading support has not been compiled in.
How can I correct this?
For reference mosquitto_pub is version 1.5.3, running on libmosquitto 1.5.3., and the command I am trying to run is:
mosquitto_pub -h <hostname> -p <port> -t "<topic>" --cafile /usr/local/etc/openssl/cert.pem -d -P "$(cat mqtt-token-pub.txt)" -u <username> -l
Note: it works if I use -m "blah" instead of -l

BumbleBEE SAT-solver compilation

Im trying to compile bumblebee sat-solver from http://amit.metodi.me/research/bee/. I have installed SWI-Prolog and MinGW already but after i type "make-minisat" in cmd i get:
A subdirectory or file ..\satsolver already exists.
In file included from Solver.h:27:0,
from pl-minisat.cpp:6:
../utils/Options.h:285:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf(stderr, "%4"PRIi64, range.begin);
^
../utils/Options.h:291:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf(stderr, "%4"PRIi64, range.end);
^
../utils/Options.h:293:25: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf(stderr, "] (default: %"PRIi64")\n", value);
^
In file included from ../core/Solver.h:27:0,
from Solver.cc:24:
../utils/Options.h:285:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf(stderr, "%4"PRIi64, range.begin);
^
../utils/Options.h:291:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf(stderr, "%4"PRIi64, range.end);
^
../utils/Options.h:293:25: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf(stderr, "] (default: %"PRIi64")\n", value);
^
pl-minisat.obj:pl-minisat.cpp:(.text+0x13): undefined reference to `PL_get_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x4d): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text+0x76): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text+0x18a): undefined reference to `PL_unify_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x1b4): undefined reference to `PL_get_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x1ed): undefined reference to `PL_unify_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x220): undefined reference to `PL_copy_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x227): undefined reference to `PL_new_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x23c): undefined reference to `PL_unify_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x24f): undefined reference to `PL_get_list'
pl-minisat.obj:pl-minisat.cpp:(.text+0x271): undefined reference to `PL_unify_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x298): undefined reference to `PL_new_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x29f): undefined reference to `PL_new_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x2a9): undefined reference to `PL_put_nil'
pl-minisat.obj:pl-minisat.cpp:(.text+0x2ec): undefined reference to `PL_put_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x2ff): undefined reference to `PL_cons_list'
pl-minisat.obj:pl-minisat.cpp:(.text+0x314): undefined reference to `PL_unify'
pl-minisat.obj:pl-minisat.cpp:(.text+0x33e): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text+0x38d): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text+0x3cb): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text+0x3d7): undefined reference to `PL_register_extensions'
pl-minisat.obj:pl-minisat.cpp:(.text+0x3e3): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text+0x44a): undefined reference to `PL_new_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x457): undefined reference to `PL_copy_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x47e): undefined reference to `PL_get_list'
pl-minisat.obj:pl-minisat.cpp:(.text+0x497): undefined reference to `PL_get_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x51a): undefined reference to `PL_get_nil'
pl-minisat.obj:pl-minisat.cpp:(.text+0x5fa): undefined reference to `PL_new_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x607): undefined reference to `PL_copy_term_ref'
pl-minisat.obj:pl-minisat.cpp:(.text+0x62e): undefined reference to `PL_get_list'
pl-minisat.obj:pl-minisat.cpp:(.text+0x647): undefined reference to `PL_get_integer'
pl-minisat.obj:pl-minisat.cpp:(.text+0x6ca): undefined reference to `PL_get_nil'
pl-minisat.obj:pl-minisat.cpp:(.text+0x808): undefined reference to `Sdprintf'
pl-minisat.obj:pl-minisat.cpp:(.text.startup+0x21): undefined reference to `PL_initialise'
pl-minisat.obj:pl-minisat.cpp:(.text.startup+0x31): undefined reference to `PL_halt'
pl-minisat.obj:pl-minisat.cpp:(.text.startup+0x36): undefined reference to `PL_toplevel'
pl-minisat.obj:pl-minisat.cpp:(.text.startup+0x46): undefined reference to `PL_halt'
collect2.exe: error: ld returned 1 exit status
g++ returned code 1
*** swipl-ld exit status 1
It looks like g++ can't reach prolog header files. Any ideas? I work on win 10, 64 bits.
There is a beta feature of Windows 10 know as WSL (Windows Subsystem for Linux), or Bash on Windows, or Bash on Ubuntu on Windows.
Bash on Windows provides developers with a familiar Bash shell and
Linux environment in which you can run most Linux command-line tools,
directly on Windows, UNMODIFIED, without needing an entire Linux
virtual machine!
I have used it to install SWI-Prolog and run some of my own Prolog programs. AFAIK I might be the only one on the planet to have done this.
I have installed it using the
PPA
or
sudo apt-get install swi-prolog-nox -y.
The PPA installs a newer version.
Plan on spending about an hour from the time you start to the time you get everything installed and updated as you are literally downloading and installing Ubuntu and all the apps from the ground up.
The WSL installation guide is here.
You are probably not on the Windows insider program, so DO NOT follow For Windows Insiders: Install Linux distribution of choice but instead follow For Anniversary Update and Creators Update: Install using lxrun.
If you run into problems I can help you, or you can post issues on the GitHub issues page, or use the SO tag wsl, or use the Ask Ubuntu tag wsl, or use the SuperUser tag windows-subsystem-linux.
I initially used it for this problem.
You need to read all of the pages noted on the left of the home page.
Breadcrumbs
Using Windows 10 install WSL per installation guide
Use the right instruction set:
For Anniversary Update and Creators Update: Install using lxrun
Note: The rest of the instructions are done within WSL or an app run from WSL
Install gcc
sudo apt-get -y install build-essential
Install SWI-Prolog - used PPA
Create directory for Bee
mkdir Bee
On my system it is eric#WINDOWS:~/projects/Bee$
Change to the Bee directory
cd ~/projects/Bee
Download Bee
wget http://amit.metodi.me/research/bee/bee20170615.zip
Uncompress zip
I installed and used 7-Zip
sudo apt-get install p7zip-full
7z x bee20170615.zip
Change to the source code directory
cd satsolver_src
Read README.txt
Build solvers using make
make satSolvers
eric#WINDOWS:~/projects/Bee/satsolver_src$ make satSolvers
rm -r -f ../satsolver
mkdir -p ../satsolver
tar xf ../satsolver_src/plSATsolver.tar.gz -C ../satsolver
tar -xf plMiniSAT_src.tar.gz -C ../satsolver
(cd ../satsolver/prologinterface && ./configure && make)
make[1]: Entering directory '/home/eric/projects/Bee/satsolver/prologinterface'
rm -f *.so
g++ -Wno-unused-result -D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -O3 -fomit-frame-pointer -s -shared -fpic -o pl-minisat.so pl-minisat.cpp \
../minisat-2.0.2/core/Solver.cc \
-L/usr/lib/swi-prolog/lib/amd64 \
-I /usr/lib/swi-prolog/include \
-I ../minisat-2.0.2/ \
-I ../minisat-2.0.2/core
make[1]: Leaving directory '/home/eric/projects/Bee/satsolver/prologinterface'
mv ../satsolver/prologinterface/pl-minisat.so ../satsolver/pl-minisat.so
rm -r -f ../satsolver/minisat-2.0.2
rm -r -f ../satsolver/prologinterface
tar xf ../satsolver_src/plGlucose_src.tar.gz -C ../satsolver
(cd ../satsolver/prologinterface && ./configure && make)
make[1]: Entering directory '/home/eric/projects/Bee/satsolver/prologinterface'
rm -f *.so
g++ -Wno-unused-result -D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -O3 -fomit-frame-pointer -s -shared -fpic -o pl-glucose.so pl-glucose.cpp \
../glucose-2.2/core/Solver.cc \
-L/usr/lib/swi-prolog/lib/amd64 \
-I /usr/lib/swi-prolog/include \
-I ../glucose-2.2/ \
-I ../glucose-2.2/core
make[1]: Leaving directory '/home/eric/projects/Bee/satsolver/prologinterface'
mv ../satsolver/prologinterface/pl-glucose.so ../satsolver/pl-glucose.so
rm -r -f ../satsolver/glucose-2.2
rm -r -f ../satsolver/prologinterface
tar xf ../satsolver_src/plGlucose4_src.tar.gz -C ../satsolver
(cd ../satsolver/prologinterface && ./configure && make)
make[1]: Entering directory '/home/eric/projects/Bee/satsolver/prologinterface'
rm -f *.so
g++ -Wno-unused-result -D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -O3 -fomit-frame-pointer -s -shared -fpic -o pl-glucose4.so pl-glucose4.cpp \
../glucose-4/core/Solver.cc \
-L/usr/lib/swi-prolog/lib/amd64 \
-I /usr/lib/swi-prolog/include \
-I ../glucose-4/ \
-I ../glucose-4/core
make[1]: Leaving directory '/home/eric/projects/Bee/satsolver/prologinterface'
mv ../satsolver/prologinterface/pl-glucose4.so ../satsolver/pl-glucose4.so
rm -r -f ../satsolver/glucose-4
rm -r -f ../satsolver/prologinterface
eric#WINDOWS:~/projects/Bee/satsolver_src$
Verify executables created
cd ..
cd satsolver
ll
eric#WINDOWS:~/projects/Bee/satsolver$ ll
total 372
drwxrwxrwx 0 eric eric 4096 Jul 31 07:12 ./
drwxrwxrwx 0 eric eric 4096 Jul 31 07:11 ../
-rwxrwxrwx 1 eric eric 101200 Jul 31 07:12 pl-glucose4.so*
-rwxrwxrwx 1 eric eric 80656 Jul 31 07:12 pl-glucose.so*
-rwxrwxrwx 1 eric eric 68360 Jul 31 07:12 pl-minisat.so*
-rw-r--r-- 1 eric eric 10268 Apr 1 2016 satsolver.pl
eric#WINDOWS:~/projects/Bee/satsolver$
Run first example from README.txt
swipl
[satsolver].
sat([[A,-B],[-A,B]]).
eric#WINDOWS:~/projects/Bee/satsolver$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.4.2)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- [satsolver].
% SWI-Prolog interface to Glucose v2.2 ... OK
true.
?- sat([[A,-B],[-A,B]]).
A = B, B = -1.

Resources