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

Build system does not respect DESTDIR #21

Closed
FFY00 opened this issue Jun 26, 2020 · 9 comments
Closed

Build system does not respect DESTDIR #21

FFY00 opened this issue Jun 26, 2020 · 9 comments

Comments

@FFY00
Copy link

FFY00 commented Jun 26, 2020

$ make PREFIX=/usr DESTDIR=dest install
make -C fasm-plugin test
make -C xdc-plugin test
make[1]: Entering directory '/home/anubis/git/symbiflow-arch-pkgs/yosys-symbiflow-plugins-git/src/yosys-symbiflow-plugins/fasm-plugin'
make[1]: Entering directory '/home/anubis/git/symbiflow-arch-pkgs/yosys-symbiflow-plugins-git/src/yosys-symbiflow-plugins/xdc-plugin'
gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -ggdb -I/usr/share/yosys/include -MD -D_YOSYS_ -fPIC -I/usr/include -std=c++11 -Os -DYOSYS_ENABLE_READLINE -DYOSYS_ENABLE_PLUGINS -DYOSYS_ENABLE_GLOB -DYOSYS_ENABLE_ZLIB -DYOSYS_ENABLE_TCL -DYOSYS_ENABLE_ABC -DYOSYS_ENABLE_COVER -D_FORTIFY_SOURCE=2  -c -o xdc.o xdc.cc
gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -ggdb -I/usr/share/yosys/include -MD -D_YOSYS_ -fPIC -I/usr/include -std=c++11 -Os -DYOSYS_ENABLE_READLINE -DYOSYS_ENABLE_PLUGINS -DYOSYS_ENABLE_GLOB -DYOSYS_ENABLE_ZLIB -DYOSYS_ENABLE_TCL -DYOSYS_ENABLE_ABC -DYOSYS_ENABLE_COVER -D_FORTIFY_SOURCE=2  -c -o fasm.o fasm.cc
mkdir -p /usr/share/yosys/plugins/fasm_extra_modules/
mkdir: cannot create directory ‘/usr/share/yosys/plugins’: Permission denied
make[1]: *** [Makefile:18: install_modules] Error 1
make[1]: *** Waiting for unfinished jobs....
@Xiretza
Copy link
Contributor

Xiretza commented Jan 22, 2021

@tcal-x
Copy link

tcal-x commented Apr 19, 2022

I came here to file the same issue.

https://www.gnu.org/prep/standards/html_node/DESTDIR.html

@mkurc-ant
Copy link
Collaborator

The thing with Yosys plugins is that they have to be installed in a specific directory in order for Yosys to find them later. This happens automatically because the build system relies on Yosys binaries (namely yosys-config). Why do you need to insall them to a different directory?

If you want to build and install plugins for Yosys that resides under a specific path you may set the YOSYS_PATH variable accordingly while invoking make

YOSYS_PATH ?= $(realpath $(dir $(shell which yosys))/..)

@Xiretza
Copy link
Contributor

Xiretza commented Apr 21, 2022

Why do you need to insall them to a different directory?

In order to create a package. All files are make installed to a staging directory ($DESTDIR), which is then tared up by the packaging scripts.

If you want to build and install plugins for Yosys that resides under a specific path you may set the YOSYS_PATH variable accordingly while invoking make

No, yosys and yosys-config are installed in their proper place (/usr/bin/) in the build environment, nothing needs to be changed there.

@alanvgreen
Copy link

@mkurc-ant It is possible to build plugins with yosys at a non-default location. For example, if yosys is to be installed in /foo/bin, first build yosys with make PREFIX=/foo. This creates a yosys-config with the correct paths (i.e to /foo/bin, /foo/share etc).

Then, as recommended by @Xiretza, build yosys plugins, with YOSYS_PATH=/foo make.

See https://github.com/google/CFU-Playground/blob/main/scripts/install_oxide#L73

@mkurc-ant
Copy link
Collaborator

@alanvgreen Yes, that's definitely possible but as I understand @Xiretza wants to override those paths anyways. Let me work on adding that to the makefile.

@mkurc-ant
Copy link
Collaborator

I've created a PR which enables specifying DESTDIR: #306

@tmichalak
Copy link
Collaborator

Fixed with #306

@Xiretza
Copy link
Contributor

Xiretza commented Jun 1, 2022

Later amended by #323.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants