Opened 15 years ago

Closed 14 years ago

#19087 closed defect (worksforme)

llvm-2.5 configure error: install places symbolic links in ocaml libraries incorrectly

Reported by: Bernard.Sufrin@… Owned by: erickt@…
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: ocaml llvm Cc: birenroy@…
Port: llvm

Description

The llvm port sets up ocaml libraries if ocaml is present when llvm is installed. But it places incorrect symbolic links in /opt/local/lib/ocaml.

The following appears to corrects the problem:

# *2 - correct the incorrect links in /opt/local/lib//ocaml
cd /opt/local/lib/ocaml
sudo rm libLLVM*.a rm LLVM*.o
sudo ln -s /opt/local/lib/libLLVM* .

There appear to be references in the compiled ocaml bindings for llvm to files in the directory:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/

But after a port clean this directory doesn't exist. The following appears to fix the problem:

# *1 - link all the LLVM*.o files to the place where (ocalbuild) thinks they are

sudo mkdir -p /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/
sudo ln -s /opt/local/lib/LLVM*.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/

I apologise that I am not a macports adept and do not know how to correct the port itself.

Change History (11)

comment:1 Changed 15 years ago by Bernard.Sufrin@…

Cc: Bernard.Sufrin@… added

Cc Me!

comment:2 Changed 15 years ago by mf2k (Frank Schima)

Cc: Bernard.Sufrin@… removed
Owner: changed from macports-tickets@… to erickt@…

comment:3 Changed 15 years ago by erickt@…

Hello! I'm not sure if I'm getting this problem. In my install I got:

lrwxrwxr-x  1 root  admin  36 Mar 29 18:26 /opt/local/lib/ocaml/LLVMExecutionEngine.o@ -> /opt/local/lib/LLVMExecutionEngine.o
lrwxrwxr-x  1 root  admin  32 Mar 29 18:26 /opt/local/lib/ocaml/LLVMInterpreter.o@ -> /opt/local/lib/LLVMInterpreter.o
lrwxrwxr-x  1 root  admin  24 Mar 29 18:26 /opt/local/lib/ocaml/LLVMJIT.o@ -> /opt/local/lib/LLVMJIT.o
lrwxrwxr-x  1 root  admin  34 Mar 29 18:26 /opt/local/lib/ocaml/LLVMX86AsmPrinter.o@ -> /opt/local/lib/LLVMX86AsmPrinter.o
lrwxrwxr-x  1 root  admin  31 Mar 29 18:26 /opt/local/lib/ocaml/LLVMX86CodeGen.o@ -> /opt/local/lib/LLVMX86CodeGen.o

What are you getting? Oh, and did you build it with "+ocaml"? Maybe it's doing something wrong if you don't specify the variant.

comment:4 in reply to:  3 Changed 15 years ago by Bernard.Sufrin@…

Replying to erickt@…:

The first time I built it one one of my OSX machines I didn't use +ocaml.

I later did an uninstall and a clean and tried to reinstall everything again. I got symlinks in /opt/local/lib/ocaml to the libLLVM*.o files -- as if they were located in /, rather than /opt/local/lib.

It also appeared that there were references from compiled code to LLVM*.o files located in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/

When I did the ocaml then llvm+ocaml install on a clean (ocaml and llvm virgin) OSX machine in desperation yesterday none of the above happened. So I presume whatever went wrong was on account of something that went wrong with my uninstall/clean.

comment:5 Changed 15 years ago by erickt@…

How odd. You may want to try deactivating llvm and make sure there aren't any of the llvm files in /opt/local/lib/ocaml and /opt/local/lib/. Maybe some of them were left around from an older install that confused llvm while it was building.

comment:6 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

comment:7 Changed 15 years ago by birenroy@…

Cc: birenroy@… added

Cc Me!

comment:8 Changed 15 years ago by birenroy@…

I also encountered this issue. I installed llvm without +ocaml first, and encountered problems compiling anything using the llvm_executionengine library. I tried uninstalling llvm, and installing the +ocaml variant, but the problem persists. Here's some more info:

$ port installed | grep ocaml
  llvm @2.5_0+ocaml (active)
  ocaml @3.10.2_0+darwin_9
  ocaml @3.11.0_0 (active)
  ocaml-mode.el @3.05_0 (active)

$ strings /opt/local/lib/ocaml/llvm_executionengine.cma | grep _opt_
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/LLVMJIT.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/LLVMExecutionEngine.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/LLVMInterpreter.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/LLVMX86CodeGen.o
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/build/Release/lib/LLVMX86AsmPrinter.o

As you can see, the llvm_executionengine.cma library refers to the build directory.

The steps I followed to try to get my install working were:

$ sudo port deactivate llvm
$ sudo port uninstall llvm
$ sudo port clean llvm
$ sudo port install llvm +ocaml

Before installing llvm, I made sure that there were no llvm libraries in /opt/local/lib or /opt/local/lib/ocaml. Please let me know if you have any suggestions.

comment:9 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Is this still an issue with llvm 2.6?

comment:10 Changed 14 years ago by macports@…

I tested the llvm 2.7 port in #24112 and this issue does not seem to exist there.

comment:11 Changed 14 years ago by mfeiri

Resolution: worksforme
Status: newclosed

Can't reproduce with llvm 2.8.

Note: See TracTickets for help on using tickets.