hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

pure reduce linking errors #99

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I followed http://docs.pure-lang.googlecode.com/hg/pure-reduce.html to 
install pure-reduce 

What is the expected output? What do you see instead?
I expected a working pure-reduce module, but instead got loads of linking 
errors and a failed build. The last lines of the build log are (see attached 
file for the full log):
(.text+0x23380): multiple definition of `double_funargedn'
reduce-algebra/csl/new-embedded/procedural/eval1.o:eval1.c:(.text+0x2aa0): 
first defined here
reduce-algebra/csl/new-embedded/reduce-image/reduce: In function 
`read_action_list':
(.text+0x1bc30): multiple definition of `read_action_list'
reduce-algebra/csl/new-embedded/procedural/cslread.o:cslread.c:(.text+0x12a0): 
first defined here
reduce-algebra/csl/new-embedded/reduce-image/reduce: In function `Lnext_random':
(.text+0x82a0): multiple definition of `Lnext_random'
reduce-algebra/csl/new-embedded/procedural/arith06.o:arith06.c:(.text+0x1af0): 
first defined here
reduce.img: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [reduce] Error 1

What version of the product are you using? On what operating system?
I tried both the latest source code
hg clone https://code.google.com/p/pure-lang/
and version 0.56 of pure with version 0.2 of pure-reduce

Please provide any additional information below.
I have attached a log file from the pure-reduce build and the image.log file 
created by that build.

Original issue reported on code.google.com by edwinv...@gmail.com on 4 Jan 2013 at 10:47

Attachments:

GoogleCodeExporter commented 8 years ago
I also tried following the steps in pure_reduce.txt, but that does not work on 
a 64 bit system, since the reduce.dll is 32 bit instead of 64 bit.

Original comment by edwinv...@gmail.com on 4 Jan 2013 at 1:15

GoogleCodeExporter commented 8 years ago
It would be good to know which system you're building this on (Linux/*BSD 
flavour, uname -a, gcc --version). Also, could you please post the output of 
these three commands:

pkg-config pure --variable DLL
pkg-config pure --variable PIC
pkg-config pure --variable shared

The compilation seems to go well until line 106 in the build log. That's when 
things go bonkers, and indeed that compile command looks badly garbled. The 
output options are completely wrong, as is the list of linked objects (in 
particular, it contains the reduce executable and image file, which have no 
place there whatsoever; this also explains the linkage errors). As to what 
might be the cause for this, I'm at a loss. Can you please attach the 
pure-reduce/Makefile that you used so that I can take a look at it?

Original comment by aggraef@gmail.com on 15 Jan 2013 at 11:46

GoogleCodeExporter commented 8 years ago
I'm afraid that all three commands return nothing. This is on a gentoo system 
with gcc 4.6.3.
$ uname -a
Linux rincewind 3.3.8-gentoo #2 SMP PREEMPT Mon Aug 13 11:30:17 BST 2012 x86_64 
Intel(R) Xeon(R) CPU W3565 @ 3.20GHz GenuineIntel GNU/Linux
$ gcc --version
gcc (Gentoo 4.6.3 p1.6, pie-0.5.2) 4.6.3
$ pkg-config --version
0.27.1

I also tried it on a linux mint debian version, but there the compilation fails 
with:
echo "Unable to build 32 bit application" && exit 1 && -O2 -I. -DPAGE_BITS=19 
-DHAVE_CONFIG_H=1 -DEMBEDDED=1 -c -o arith01.o ../../cslbase/arith01.c
Unable to build 32 bit application

Original comment by edwinv...@gmail.com on 15 Jan 2013 at 2:43

GoogleCodeExporter commented 8 years ago
> I'm afraid that all three commands return nothing.

Hmm, could you please attach your pure.pc? (Should be in /usr/lib/pkgconfig or 
/usr/local/lib/pkgconfig.)

> I also tried it on a linux mint debian version, but there the compilation 
fails with:
> echo "Unable to build 32 bit application"

Yeah, the CSL Makefiles are a mess. They contain some awful hacks to ensure 
that it can do 32 bit builds even though the entire thing builds just fine as 
64 bit. IIRC, installing the libc6-dev-i386 package fixes that issue. I should 
probably add that to the README. Can you please confirm that this solves your 
build issue?

Original comment by aggraef@gmail.com on 15 Jan 2013 at 10:13

GoogleCodeExporter commented 8 years ago
I found pure.pc at /usr/local/lib64/pkgconfig/pure.pc (/usr/local/lib is a 
symlink to /usr/local/lib64) and I attached it (it looks fine to me :) ). I 
guess this means that the problem is on my end.

Installing libc6-dev-i386 has worked for the linux mint machine. Thanks!

Original comment by edwinv...@gmail.com on 16 Jan 2013 at 7:35

Attachments:

GoogleCodeExporter commented 8 years ago
I now set PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig and it compiled fine. So 
the error must be in the pkgconfig configuration somewhere. I guess this issue 
can be closed.

Thank you for the help and also thanks for creating such a great language that 
might finally really bridge the gap between computer algebra systems and 
computer programming :)

Original comment by edwinv...@gmail.com on 16 Jan 2013 at 8:02

GoogleCodeExporter commented 8 years ago
Well, the pkgconfig dir is set when Pure is configured, so autoconf at least 
thinks that /usr/local/lib64 is the proper libdir for your system. If you have 
autoconf installed, you could try whether running autoreconf and then 
reconfiguring and rebuilding Pure changes anything.

Thanks for trying out pure-reduce; let me know how it works for you. :) Oh and 
btw, if you know TeXmacs, make sure to give the Pure TeXmacs plugin a try, it 
integrates nicely with Reduce and Octave and makes for a great interactive 
frontend for Pure with TeX-like typesetting capabilities 
(http://code.google.com/p/pure-lang/wiki/TeXmacs).

Original comment by aggraef@gmail.com on 16 Jan 2013 at 8:49