Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lot of build errors on FreeBSD #10

Closed
yurivict opened this issue Oct 28, 2018 · 21 comments
Closed

A lot of build errors on FreeBSD #10

yurivict opened this issue Oct 28, 2018 · 21 comments
Assignees
Labels
contribution Contributions from people to project feature request Feature request
Milestone

Comments

@yurivict
Copy link

Missing #include <sys/syslimits.h>:

profiler.cpp:106:35: error: use of undeclared identifier 'PATH_MAX'
            strncpy(sFile, fname, PATH_MAX);
                                  ^

Also missing isinff.

Also this error:

profiler.cpp:744:9: error: cannot initialize object parameter of type 'lsp::ITask' with an expression of type 'lsp::profiler_mono::Saver'
        pSaver->reset();
        ^~~~~~

FreeBSD 11.2 amd64, compiler is clang-6.

@sadko4u
Copy link
Collaborator

sadko4u commented Oct 28, 2018

Hi there!
For your case I've created github-issue-10 branch and committed some code for better BSD compatibility: 8ec19d5
Anyway, I've never tried to build plugins with CLang and for FreeBSD, so probably this will require a lot of feedback from your side.

@yurivict
Copy link
Author

There are also errors:

In file included from /usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/ui/ctl/ctl.h:21:
In file included from /usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/ui/tk/tk.h:241:
/usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/ui/tk/widgets/dialogs/LSPFileDialog.h:116:In file included from native.cpp:32:
/usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/dsp/arch/native/float.h:38:22: error: use of undeclared identifier 'isinff'; did you mean 'isinf'?
            else if (isinff(v))
                     ^~~~~~
                     isinf
/usr/include/c++/v1/math.h:473:1: note: 'isinf' declared here
isinf(_A1 __lcpp_x) _NOEXCEPT
^
37: warning: 'lsp::tk::LSPFileDialog::on_mouse_dbl_click' hides
      overloaded virtual function [-Woverloaded-virtual]
                virtual status_t    on_mouse_dbl_click(void *data);
                                    ^
/usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/ui/tk/basic/LSPWidget.h:567:34: note: hidden overloaded virtual function
      'lsp::tk::LSPWidget::on_mouse_dbl_click' declared here: type mismatch at 1st parameter ('const lsp::ws::ws_event_t *' vs 'void *')
                virtual status_t on_mouse_dbl_click(const ws_event_t *e);
                                 ^
CtlPadding.cpp:43:17: error: use of undeclared identifier 'strtoll'
                PARSE_INT(value, pPadding->set_left(__); set = true );
                ^
/usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/ui/ctl/parse.h:15:19: note: expanded from macro 'PARSE_INT'
        long __ = strtoll(var, NULL, 10); \
                  ^
CtlPadding.cpp:45:17: error: use of undeclared identifier 'strtoll'
                PARSE_INT(value, pPadding->set_right(__); set = true );
                ^
/usr/ports/audio/lsp-plugins-lv2/work/lsp-plugins-8ec19d5/include/ui/ctl/parse.h:15:19: note: expanded from macro 'PARSE_INT'
        long __ = strtoll(var, NULL, 10); \
                  ^
CtlPadding.cpp:47:17: error: use of undeclared identifier 'strtoll'
                PARSE_INT(value, pPadding->set_top(__); set = true );
                ^

@sadko4u
Copy link
Collaborator

sadko4u commented Oct 29, 2018

Another one commit: 731b138

@sadko4u sadko4u added contribution Contributions from people to project feature request Feature request labels Oct 29, 2018
@yurivict
Copy link
Author

yurivict commented Oct 30, 2018

You need to add #include <limits.h> in every file where you use PATH_MAX because its definition isn't found.

@sadko4u
Copy link
Collaborator

sadko4u commented Oct 30, 2018

I think I need to install FreeBSD in some virtual environment, this will be faster rather than blowing up this topic. It would be nice from your side to provide script for FreeBSD for installing all pre-requisited packages for building plugins.

@yurivict
Copy link
Author

I didn't reach the point when I could add dependencies, but generally lv2 plugins need the lv2 package that can be installed with pkg install lv2. Other packages are installed in the same way.

@sadko4u sadko4u self-assigned this Nov 1, 2018
@sadko4u sadko4u added this to the 1.1.5 milestone Nov 1, 2018
@sadko4u
Copy link
Collaborator

sadko4u commented Nov 1, 2018

Seems to be built well with GCC after this commit: b060ca3
Please try.

@yurivict
Copy link
Author

yurivict commented Nov 1, 2018

How about with clang?

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 1, 2018

Not today. Maybe in the nearest future.

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 2, 2018

Today tried to build with clang:

fatal error: error in backend: Cannot select: 0x805a3e270: v4f32 = fp_extend 0x805a3e8f0
  0x805a3e8f0: f32,ch = CopyFromReg 0x805697c40, Register:f32 %1
    0x805a3ec30: f32 = Register %1
In function: _ZN3sse4fillEPffm
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd11.2
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/sse-f619de.cpp
clang: note: diagnostic msg: /tmp/sse-f619de.sh
clang: note: diagnostic msg: 

********************
gmake[2]: *** [Makefile:51: /usr/home/sadko/git/lsp-plugins/.build/src/dsp/sse.o] Error 70
gmake[1]: *** [Makefile:25: dsp] Error 2
gmake: *** [Makefile:238: compile] Error 2

Sorry, but clang can not compile simpliest inline assembly code with SIMD instructions.
Here's the code snippet:
clang-test.cpp.gz

If you have any ideas about how to properly compile this code, you're welcome. I've tried it with:

clang -o clang-test -std=c++98 -msse -O2 clang-test.cpp

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 2, 2018

Same problem with clang7 on linux:

fatal error: error in backend: Cannot select: 0x17cb700: v4f32 = fp_extend 0x17cc058
  0x17cc058: f32,ch = CopyFromReg 0x1707d28, Register:f32 %1
    0x17cc0c0: f32 = Register %1
In function: _ZN3sse4fillEPffm
clang-7.0.0: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 7.0.0 (tags/RELEASE_700/final 342370)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-7.0.0: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-7.0.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7.0.0: note: diagnostic msg: /tmp/sse-7e9de1.cpp
clang-7.0.0: note: diagnostic msg: /tmp/sse-7e9de1.sh
clang-7.0.0: note: diagnostic msg:

@yurivict
Copy link
Author

yurivict commented Nov 2, 2018

Thank you for providing the testcase. I've created the clang and FreeBSD bug reports: https://bugs.llvm.org/show_bug.cgi?id=39539

@yurivict
Copy link
Author

yurivict commented Nov 2, 2018

I have a question: is it possible to make LADSPA optional? LADSPA is obsolete, superceeded by LV2 and we would rather keep it out.

@yurivict
Copy link
Author

yurivict commented Nov 2, 2018

I tried INSTALLATIONS="install_lv2 install_jack" but the build still breaks.

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 2, 2018

You can install LADSPA, LV2, VST, JACK and documentation separately:

make install_ladspa
make install_lv2
make install_vst
make install_jack
make install_doc

For FreeBSD it will be:

gmake install_ladspa
gmake install_lv2
gmake install_vst
gmake install_jack
gmake install_doc

@yurivict
Copy link
Author

yurivict commented Nov 2, 2018

It is run in 2 steps: build and install. Is there the build_lv2 target?

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 2, 2018

No, there's no build_lv2 target, Plugins are always build as a complete set of formats. You currently can restrict only installation. But I think I can add special variable to do so.

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 2, 2018

Please try this commit: 099155b
Added the following documentation to README:

By default, all supported formats of plugins are built. You may control
list of built plugin formats by specifying BUILD_MODULES variable:

  make clean
  make BULD_MODULES='lv2 vst doc'
  make install

Available modules are:

  • ladspa - LADSPA plugin binaries
  • lv2 - LV2 plugin binaries
  • vst - LinuxVST plugin binaries
  • jack - JACK plugin binaries
  • doc - HTML documentation

Also possible (but not recommended) to specify compile targets:

  make clean
  make build_ladspa
  make build_lv2
  make build_vst
  make build_jack
  make build_doc

@yurivict
Copy link
Author

yurivict commented Nov 3, 2018

Thank you for fixing the issues fast.

I've created the FreeBSD port for lsp-plugins.

Cheers,
Yuri

@sadko4u
Copy link
Collaborator

sadko4u commented Nov 3, 2018

Merged changes into devel branch: 90c1e2a
I'm closing the issue. When clang will be fixed, you can open new issue for it's support.

@sadko4u sadko4u closed this as completed Nov 3, 2018
@yurivict
Copy link
Author

yurivict commented Nov 3, 2018

Ok, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Contributions from people to project feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants