grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.53k stars 319 forks source link

Doesn't install music.lib #134

Closed yurivict closed 6 years ago

yurivict commented 6 years ago

Trying this testcase: https://ccrma.stanford.edu/~jos/spf/Simple_Example_FAUST_Program.html

Compiler is looking for music.lib here /usr/local/share/faust/music.lib but it isn't installed.

After the build is done, 2 files with this name are left:

./work/faust-2.5.17/embedded/faust4processing/src/faust-libraries/music.lib
./work/faust-2.5.17/tests/impulse-tests/codes-to-test/music.lib

The only line in makefiles that installs it is: embedded/faust4processing/Makefile: cp src/faust-libraries/* $(DST)/library but it isn't installed. library is also a wrong directory.

What am I missing?

faust-2.5.17

agraef commented 6 years ago

First, that little program you linked to doesn't even import music.lib (and it doesn't need it), so why should the compiler go looking for it?

Second, if your source tree doesn't have faust-2.5.17/libraries/old/music.lib then you're building the wrong source! (I've told you this before.) Ignore the auto-generated https://github.com/grame-cncm/faust/archive links, they're useless (but unfortunately github doesn't offer a way to disable them). Here's the tarball that you have to use: https://github.com/grame-cncm/faust/releases/download/2.5.17/faust-2.5.17.tar.gz. This contains the libraries submodule and a gmake && gmake install will give you a working Faust installation.

sletz commented 6 years ago

This faust4processing subproject sill uses a set of old format libraries, and a set of DSPs using this old format libraries... All this stuff will have to be adapted at some point. Since nobody I'm aware of uses this project, this is not a priority for now.

(but if someone submit a proper PR to cleanup, this would be helpful)

yurivict commented 6 years ago

Yes, my source tree didn't have faust-2.5.17/libraries/old/music.lib, and tarball has it. Not sure why does tarball deviate from github here so much.

But music.lib is still not installed. The list of installed files didn't change with tarball.

First, that little program you linked to doesn't even import music.lib (and it doesn't need it), so why should the compiler go looking for it?

I have no idea, but it does look for it.

Both faust2jack and faust2jaqt are looking for it like this:

$ faust2jack stanford.dsp 
ERROR : /usr/local/bin/faust2jack cannot find Faust library dir (usually /usr/local/share/faust)
stanford;
agraef commented 6 years ago

@yurivict wrote:

Yes, my source tree didn't have faust-2.5.17/libraries/old/music.lib, and tarball has it. Not sure why does tarball deviate from github here so much.

You know about git submodules, don't you? That libraries subdir is actually a submodule, and can only be populated using git if you're actually doing it in a clone of the repository. The GH auto-generated tarballs are just shallow snapshots of the current repository state, no git repos, and so populating the submodule won't work from them. The proper tarball I pointed you is created with make dist instead, it has everything you need.

But music.lib is still not installed. The list of installed files didn't change with tarball.

All I can say is that it works on my end, on Arch, Ubuntu and Mac. Complete build and install log, please. Also include an ls -R of the directory where you're doing the build.

I have no idea, but it does look for it.

The Faust compiler doesn't look for it (unless there's an import in the program you're compiling), but some of the faust2xxx scripts do, in order to locate the Faust library directory.

yurivict commented 6 years ago

Complete build and install log, please.

https://pastebin.com/YqpYReXY

agraef commented 6 years ago

@yurivict: I also need the ls -R of the build directory (after unpacking of the source and applying patches). Or better yet, just zip it up and attach the tarball here.

EDIT: Not necessary just yet, think I found it, see below.

agraef commented 6 years ago

What's this? (from the log)

#cp libraries/old/*.lib /usr/ports/audio/faust/work/stage/usr/local/share/faust/
#cp libraries/*.lib /usr/ports/audio/faust/work/stage/usr/local/share/faust/

This isn't commented out upstream. That's exactly where the library files normally get copied over to $(prefix)/share/faust/.

agraef commented 6 years ago

@yurivict, this is in your port's Makefile, line 85:

    @${REINPLACE_CMD} -i '' "s|cp libraries/old/|#cp libraries/old/| ; s|cp libraries/\*\.lib|#cp libraries/*.lib|" \
        ${WRKSRC}/Makefile

So your port deliberately disables installation of the library files. Which is why your Faust installation is broken. Or do you have a separate port to install the library files?

agraef commented 6 years ago

I think that you probably did that because installation of the library files was broken with the GH-generated tarballs, and then forgot about it. Get rid of that line in your Makefile and you should be fine.

agraef commented 6 years ago

@yurivict have you disappeared? No need to be ashamed, we all do silly blunders like this every once in a while. ;-) Anyway, if this solves your problem then please close this bug.

yurivict commented 6 years ago

have you disappeared?

No LOL, we are likely in different time zones!

So your port deliberately disables installation of the library files.

I see, thanks! I will look into this today.

yurivict commented 6 years ago

@agraef The lack of the libraries module and a bad patch were the reason of the problem. Now it works fine.

Thank you for your help!