-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Makefile name collision #1796
Comments
The AR/ARCH confusion is a result of LAPACK being a separate project - the lapack-netlib tree is imported from https://github.com/Reference-LAPACK/lapack. To me the fundamental problem appears to be that your build environment is autodetected as "amd64" although this should get mapped to "x86_64" within c_check since version 0.2.13, about 4 years ago. Which version of OpenBLAS are you trying to build ? |
I am using this github repo commit: 6e2c494 |
It looks wrong. if arch is say aarch64 you should not build forcibly x86_64/amd64 assembly which will fail. |
Your right, my code changes was just a way to get the project to build on this current machine which is x86_64. This patch would break other platforms. You understand this codebase a lot better than I do, I would hope that you could recommend a fix. A quick solution is use different variable names. Having Would it be possible to be ARCH and ARCH_CMD or something to differentiate the variables? |
It is a massive change, i'd say impossible. |
There's no way to avoid this variable name collision? |
Easy workaround is to install binary port in chroot jail. Can you post build logs (record via "script", then upload/attach) from freebsd and from chroot jail? |
Here's the build log for the successul chrooted build with the patches: https://transfer.sh/ks19G/12amd64-FLANG.log build log without the patches, the build detects amd64 instead of x86_64 and fails: Now after that failure I am logged into the chrooted env, if I go to the src directory and run gmake the build succeeds: https://transfer.sh/6W2ey/GMAKE |
At first glance the problem seems to be that you have ARCH set in the environment (which is probably legit but confuses the build system). I suspect this is what will need to be worked around. |
Build log from build on a clean FreeBSD machine as unprivileged user? |
Could you build netlib BLAS+LAPACK from ports with same "poudriere" configuration? |
The current ports tree is broken but I have fixed it in my local repo, it successfully builds in poudriere: https://transfer.sh/Rn6MG/12amd64-FLANG.log |
Quick fix would be unset-ting ARCH environment variable in offended ports |
the jail doesn't allow to unsetenv root@12amd64-FLANG:~ # /bin/sh unsetenv
/bin/sh: cannot open unsetenv: No such file or directory |
it is shell built-in |
FreeBSD jails has several steps pre-fetch
do-fetch
post-fetch
pre-extract
do-extract
post-extract
pre-patch
do-patch
post-patch
pre-configure
do-configure
post-configure
pre-build
do-build
post-build
pre-install
do-install
post-install
post-stage
pre-package
do-package
post-package Where you can overwrite and apply custom commands. I've tried placing unsetenv HOST After the build fails, then I get dropped into a shell that allows me to run unsetenv. |
Seems related to #1753 (which should already take care of the LAPACK make.inc part of the problem), just that ARCH may need to be overridden in Makefile.prebuid or Makefile.system |
or a paranoid entrance to /Makefile that says to unset variables used internally? |
Can't reproduce your problem with current develop (though I am on Linux, setting ARCH=amd64 from outside should have the same unwanted effect there). Is "openblas-0.2.20" just an oversight in the package name quoted in your log, or could it be you accidentally tried to build that old version there ? |
That's an artifact from the older code. I am pulling directly from this repo and commit |
@teamblubee any step invoking 'make' should be invoked without ARCH variable set. |
Let me bring this up on that project and see how that goes. |
Thanks, any feedback welcome. |
@martin-frbg @teamblubee I think worth updating topic with FreeBSD 12, to avoid general panic |
Hmm. I can now reproduce with
near the top of Makefile.system (not sure if the outer ifdef is strictly necessary) |
or
|
Neither helps against environment. It seems to pick environemnt by preference anyway. |
Maybe it outputs a warning |
I tested the latest commit: 697dc1b The error still persists but after your examples I added this patch file to the Makefile and the project builds no problems --- Makefile.system.orig 2018-10-09 06:59:21 UTC
+++ Makefile.system
@@ -9,6 +9,12 @@ ifndef TOPDIR
TOPDIR = .
endif
+ifdef ARCH
+ifeq ($(ARCH), amd64)
+override ARCH=x86_64
+endif
+endif
+
NETLIB_LAPACK_DIR = $(TOPDIR)/lapack-netlib
# Default C compiler Can a change like this be upstreamed? |
For completeness should be also |
Can we expect these names to show up at all ? |
@teamblubee is in position to tell if amd64 crossbuilds for i386 what we do get ;) |
I do not have an i386 env setup at this moment, I'll create one and report back. |
I won't be able to test this for a while as my dev toolchain has some issue and I am in the middle of another project; I will test this when I am able to update my toolchain. |
I am running into issues building openblas where the Makefile variable $(ARCH) has two different meanings.
1)architecture; x86, x86_64, etc..
2)ar command
Testing this project in FreeBSD jails I run into a bug where the host is detected as amd64 then the Makefile fails as there's no Makefile.amd64 okay setting ARCH to x86_64 then later the build fails because "x86_64" is not a valid command; In this case $(ARCH) should be the archive command ar.
I hacked together this patch to get the project to build but I hope that something more general could be implemented.
The main issue is caused by the Makefile variable name ARCH that has different meanings based on context.
The text was updated successfully, but these errors were encountered: