grame-cncm / faust

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

.h files NOT FOUND by faust-git #22

Closed magnetophon closed 7 years ago

magnetophon commented 7 years ago

When I compile any dsp with faust2jack or faust2jaqt from git, either faust 1 or 2, I get:

NOT FOUND faust/dsp/timed-dsp.h
NOT FOUND faust/gui/PathBuilder.h
NOT FOUND faust/gui/FUI.h
NOT FOUND faust/gui/JSONUI.h
NOT FOUND faust/misc.h
NOT FOUND faust/gui/faustqt.h
NOT FOUND faust/audio/jack-dsp.h
NOT FOUND faust/gui/OSCUI.h
NOT FOUND faust/gui/httpdUI.h
NOT FOUND faust/gui/MidiUI.h
NOT FOUND faust/midi/rt-midi.h
NOT FOUND faust/midi/RtMidi.cpp
NOT FOUND faust/dsp/poly-dsp.h
NOT FOUND faust/dsp/dsp-combiner.h

presumably from compiler/parser/enrobage.cpp.

The release versions do not have this problem.

ntonnaett commented 7 years ago

When trying to compile piano.dsp with faust2lv2 (or faust2jack) from git I get: `/tmp/faust2lv2.GppFe0/piano.cpp:12:19: schwerwiegender Fehler: piano.h: Datei oder Verzeichnis nicht gefunden

include

` Maybe it's the same cause. It's not related to the brackets instead of quotes.

EDIT: Happens with faust 0.9.95 too.

sletz commented 7 years ago

Working here on git. Which Faust version are you using ?

ntonnaett commented 7 years ago

I'm on master branch. But as it happens on 0.9.95 too, maybe it's caused by the compiler stack. I'm on Fedora 25. Should the piano.h be copied to the tmp folder or how is it supposed to work?

agraef commented 7 years ago

@sletz It depends on which source you try to compile. The problem is with dsp sources which require an external C header, such as the STK examples (I guess that's where Bart's example comes from). In that case Faust will generate an include like

#include <stklib.h>

in the generated C++ source, and the C++ compiler will subsequently fail to find that file in the current directory. That's because without something like -I. in the compiler flags the C++ compiler will only look on the include path and not in the current directory.

I think that the proper solution for this would be to have the Faust compiler generate an include directive like

#include "stklib.h"

instead, then everything will just work with external headers which accompany the dsp source. Or, if that isn't wanted for whatever reason, we might also add -I. to the C++ compilation flags in the faust2xyz scripts instead.

@magnetophon @ntonnaett For the time being, you can work around this problem by temporarily setting the CPLUS_INCLUDE_PATH environment variable when invoking the script, e.g. (Bourne shell syntax):

CPLUS_INCLUDE_PATH=$PWD faust2lv2 piano.dsp

Note that this assumes that the required header file is in the current directory, otherwise specify whatever directory the header is in instead.

agraef commented 7 years ago

Oops, sorry, it seems that actually two different bug reports got conflated here. My remarks apply to @ntonnaett's issue. The original problem reported by @magnetophon I cannot reproduce.

ntonnaett commented 7 years ago

I create a new one.

agraef commented 7 years ago

I guess that Bart's problem was already solved in the meantime, so we might just keep to this one here. I'm not inclined to copy everything I said. :)

ntonnaett commented 7 years ago

It's not related to the brackets instead of quotes. If you change ffunction(float getValueDryTapAmpT60(float), ,""); to ffunction(float getValueDryTapAmpT60(float), "piano.h",""); there is #include "piano.h" in the generated c++ code. But the buildroot is in a new created tmp dir and there is no piano.h.

magnetophon commented 7 years ago

@agraef My problem has not been solved afaik. PS: it would help others understand the conversation better if you refer to me as magnetophon instead of Bart.

magnetophon commented 7 years ago

It seems that some commit before or at rev a3027937b734f40fb1b27fa8eb5031afd16651c5 fixes my issue.

agraef commented 7 years ago

@ntonnaett, I just went ahead and added the needed include options to faust2lv2 and faust2faustvst in master-dev rev. 54ef7ffcff6d439d355ef1f172bbec87904de21b now, so at least with these scripts your issue should be fixed now. If you notice the same hiccup with any of the other faust2xxx scripts then please report those separately.