Closed arturomarin closed 2 years ago
Try
export CFLAGS="-O3 -fsigned-char -D_FILE_OFFSET_BITS=64"
make
Thanks for trying to help me. It continue giving me the same error. I add a file with the output of the terminal. Errors_Nanopolish_arm64.txt
I have hardly any experience in C but, Could this problem be fixed by changing something in the Makefile?
Hi @arturomarin,
I have an M1 macbook pro now, and have compiled nanopolish but the changes are considerably involved. I plan to modify the makefile to do all of it automatically but haven't had time yet (I am teaching this term). I've had this request a few times so I'll try to prioritize this.
Hi @jts,
Thanks for Nanopolish and for your interest in fixing this. If I can help you with something, testing code that a newbie can try or whatever, let me know.
@arturomarin Meanwhile, if you are after call-methylation or eventalign, could you perhaps check if f5c compiles on mac M1?
I've just pushed a new branch called m1-build
. It contains a series of hacks that I made to get it compiling on my M1 pro. This version will not compile on linux and some things may be broken. I intended to clean this up but haven't found time, so I just wanted to make it available in case you want to try it.
Hi @hasindu2008 ,
I don't work with this, and right now I don't have much time to compile extra code... I'm still installing all the programs I need on my new laptop and seeing how to work better. But if you need access to Apple M1 computers to develop, maybe you can use the new AWS instances.
https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-ec2-m1-mac-instances-macos/?nc1=h_ls
Best,
Hi @jts ,
thank you. Of course I'm interested. Nanopolish is a critical part of my virus analysis pipeline, and I'm interested in getting it to work on the Apple M1. If this helps you to develop a version for Apple M1 it would be great. I don't know what I have to do to get this branch. When I go to the address "https://github.com/jts/nanopolish/tree/m1-build" in the "code" tab it says "https://github.com/jts/nanopolish.git", and when using Git I think it downloads the normal version of Nanopolish.
I have also tried with:
git clone --recursive https://github.com/jts/nanopolish/tree/m1-build
but it gives me an error:
Cloning into 'm1-build'...
fatal: repository 'https://github.com/jts/nanopolish/tree/m1-build/' not found
@arturomarin can you try cloning the normal version of nanopolish
first then switch to the m1-build
branch using the git checkout
command:
git clone --recursive git@github.com:jts/nanopolish.git
cd nanopolish
git checkout m1-build
Hi @rdeborja ,
thanks for trying to help me. The command
git clone --recursive git@github.com:jts/nanopolish.git
produces the following error
Cloning into 'nanopolish'...
The authenticity of host 'github.com (140.82.114.4)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have tried the following
git clone --recursive https://github.com/jts/nanopolish.git
cd nanopolish
git checkout m1-build
The last command gives me a warning
warning: unable to rmdir 'fast5': Directory not empty
Branch 'm1-build' set up to track remote branch 'm1-build' from 'origin'.
Switched to a new branch 'm1-build'
I have run make
, but finally got another error
clang: error: unsupported option '-fopenmp'
I am attaching all the output of the make
command, in case it can help. Any suggestion?
@arturomarin sorry for the mixup, I use ssh keys andgit clone --recursive git@github.com:jts/nanopolish.git
worked for me.
To get make
to work, I had to install libomp
using homebrew
:
brew install libomp
If you don't have homebrew installed, the changes I made to the Makefile won't work as they require it. You might have to google the m1 specific installation.
To get the Makefile
to compile, I changed a few lines. I appended the specific path for libomp
include and library files to CXXFLAGS
and CFLAGS
, add -Xclang
to CXXFLAGS
and add the -lomp
library to the LIBS
parameter.
LIBS = -lz -lomp
CXXFLAGS ?= -g -O3 -isysroot $(SDK) -I/usr/include -L/usr/lib -I/opt/homebrew/Cellar/libomp/13.0.1/include -L/opt/homebrew/Cellar/libomp/13.0.1/lib
CXXFLAGS += -std=c++11 -Xclang -fopenmp -fsigned-char -D_FILE_OFFSET_BITS=64 #D_FILE_OFFSET_BITS=64 makes nanopolish work in 32 bit systems
CFLAGS ?= -O3 -std=c99 -isysroot $(SDK) -I/usr/include -L/usr/lib -fsigned-char -D_FILE_OFFSET_BITS=64 -I/opt/homebrew/Cellar/libomp/13.0.1/include -L/opt/homebrew/Cellar/libomp/13.0.1/lib
Note that this is using the m1-build
branch that Jared originally created.
Hi,
I've had time to package this up and I have something that is worth testing. Could you try this from a clean install?
git clone --recursive git@github.com:jts/nanopolish.git
cd nanopolish
git checkout 0.14-rc
git submodule update --init --recursive
make CC=gcc-11 CXX=g++-11 CPP=cpp-11
This requires gcc to be installed (through homebrew or equivalent) since clang does not support openmp, which nanopolish currently requires. The middle two commands won't be required when I merge this in, they just grab the feature branch with the changes, then synch up the htslib.
Hi,
I can't connect to the repository
git clone --recursive git@github.com:jts/nanopolish.git
Cloning into 'nanopolish'...
The authenticity of host 'github.com (140.82.112.4)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
@arturomarin it looks like there's something wrong with the ssh
key you setup. You can either fix it or use the web URL:
git clone --recursive https://github.com/jts/nanopolish.git
@jts Thanks for the work on this. I tried the following:
git clone --recursive https://github.com/jts/nanopolish.git
cd nanopolish
git checkout 0.14-rc
git submodule update --init --recursive
make CC=gcc-11 CXX=g++-11 CPP=cpp-11
Things seemed to be working fine until the following error occurred:
gcc-11 -c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -L/usr/lib -msse2 -DHAVE_KALLOC ksw2_ll_sse.c -o ksw2_ll_sse.o
gcc-11: error: unrecognized command-line option '-msse2'
make[1]: *** [ksw2_ll_sse.o] Error 1
make: *** [minimap2/libminimap2.a] Error 255
@mmullistb try adding arm_neon=1 aarch64=1
to the make
command:
make CC=gcc-11 CXX=g++-11 CPP=cpp-11 arm_neon=1 aarch64=1
Could you also post the full output from the make command, and what gcc -dumpmachine
reports?
gcc -dumpmachine reports 'aarch64-apple-darwin20'
make CC=gcc-11 CXX=g++-11 CPP=cpp-11 arm_neon=1 aarch64=1
Worked for me! Thanks for the help!
Thanks. I was checking for arm64
in the output of gcc -dumpmachine
to set the ARM-specific flags. I'll check for aarch64
too.
@mmullistb, this case should now be detected by the makefile, do you mind trying to build again from a clean clone?
Awesome, thanks! I'll test it out tomorrow and let you know how it works.
It seems work for me too, even though I don't use exactly the same commands.
the commands I used were:
git clone --recursive https://github.com/jts/nanopolish.git
cd nanopolish
git checkout 0.14-rc
git submodule update --init --recursive
make CC=/opt/homebrew/bin/aarch64-apple-darwin21-gcc-11 CXX=/opt/homebrew/bin/aarch64-apple-darwin21-g++-11 CPP=/opt/homebrew/bin/cpp-11
I add the output of the terminal in the file "Install_Output.txt"
I have also tried to install version 0.14 with the commands that appear in https://github.com/jts/nanopolish
git clone --recursive https://github.com/jts/nanopolish.git
cd nanopolish
make
but clang gives me errors, I guess I would have to use "make CC=/opt/homebrew/bin/aarch64-apple-darwin21-gcc-11 CXX=/opt/homebrew/bin/aarch64-apple-darwin21-g++-11 CPP =/opt/homebrew/bin/cpp-11" right?
I add the terminal output of this second test to the file "Test_2.txt"
All the best,
I guess I would have to use "make CC=/opt/homebrew/bin/aarch64-apple-darwin21-gcc-11 CXX=/opt/homebrew/bin/aarch64-apple-darwin21-g++-11 CPP =/opt/homebrew/bin/cpp-11"
That's right, we don't currently support clang so you need to use GCC. Glad you got it working and thanks for the feedback!
ok, thank you very much!
Hi,
I've tried all of these and I still can not install nanopolish on my iMac m1.
The error msg is:
-11 CPP=/opt/homebrew/bin/cpp-11 if [ ! -e hdf5-1.13.0.tar.gz ]; then \ version_major_minor=
echo "1.13.0" | sed -E 's/.[0-9]+$//'`; \
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${version_major_minor}/hdf5-1.13.0/src/hdf5-1.13.0.tar.gz; \
fi
--2024-04-02 17:01:20-- https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.0/src/hdf5-1.13.0.tar.gz
Resolving support.hdfgroup.org (support.hdfgroup.org)... 50.28.50.143
Connecting to support.hdfgroup.org (support.hdfgroup.org)|50.28.50.143|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-04-02 17:01:21 ERROR 404: Not Found.
make: *** [lib/libhdf5.a] Error 8`
@AndreaYCT
This is a problem with the version of HDF5 as the FTP site hosting the bundled file will cleanup files and remove older versions. To fix this, you can go into the Makefile
and edit line 31:
(https://github.com/jts/nanopolish/blob/9d6590a0d2fd818e0fa0edbd82c824d6a7242f7c/Makefile#L31
And change it to
HDF5_VERSION ?= 1.13.3
@rdeborja, hi,
So I tried
git clone --recursive https://github.com/jts/nanopolish.git cd nanopolish nano Makefile
Confirm:
ifeq ($(MAC), 1) HDF5_VERSION ?= 1.13.3 else HDF5_VERSION ?= 1.8.14 endif " Them "make"
It installs "hdf5-1.13.3.tar.gz" but have some error msgs: tar -xjf eigen-3.3.7.tar.bz2 || exit 255 mv eigen-3.3.7 eigen || exit 255 rm -f ./.depend c++ -g -O3 -std=c++11 -fopenmp -fsigned-char -D_FILE_OFFSET_BITS=64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/usr/lib -I./include -I./htslib -I./minimap2 -I./src -I./src/hmm -I./src/thirdparty -I./src/thirdparty/scrappie -I./src/common -I./src/alignment -I./src/pore_model -I./src/io -I./src/basemods -I./eigen/ -I./slow5lib/include/ -MM src/nanopolish_call_methylation.cpp src/nanopolish_call_variants.cpp src/nanopolish_detect_polyi.cpp src/nanopolish_fast5_check.cpp src/nanopolish_haplotype.cpp src/nanopolish_index.cpp src/nanopolish_methyltrain.cpp src/nanopolish_phase_reads.cpp src/nanopolish_polya_estimator.cpp src/nanopolish_raw_loader.cpp src/nanopolish_read_db.cpp src/nanopolish_scorereads.cpp src/nanopolish_squiggle_read.cpp src/nanopolish_train_poremodel_from_basecalls.cpp src/nanopolish_variant_db.cpp src/nanopolish_vcf2fasta.cpp src/training_core.cpp src/hmm/nanopolish_duration_model.cpp src/hmm/nanopolish_profile_hmm.cpp src/hmm/nanopolish_profile_hmm_r7.cpp src/hmm/nanopolish_profile_hmm_r9.cpp src/hmm/nanopolish_transition_parameters.cpp src/common/fs_support.cpp src/common/logsum.cpp src/common/nanopolish_alphabet.cpp src/common/nanopolish_bam_processor.cpp src/common/nanopolish_bam_utils.cpp src/common/nanopolish_common.cpp src/common/nanopolish_iupac.cpp src/common/nanopolish_klcs.cpp src/common/nanopolish_variant.cpp src/alignment/nanopolish_alignment_db.cpp src/alignment/nanopolish_anchor.cpp src/alignment/nanopolish_eventalign.cpp src/pore_model/nanopolish_model_names.cpp src/pore_model/nanopolish_pore_model_set.cpp src/pore_model/nanopolish_poremodel.cpp src/io/nanopolish_fast5_io.cpp src/io/nanopolish_fast5_loader.cpp src/io/nanopolish_fast5_processor.cpp src/basemods/nanopolish_basemods.cpp src/thirdparty/fet.c src/thirdparty/stdaln.c src/thirdparty/scrappie/event_detection.c src/thirdparty/scrappie/scrappie_common.c clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] clang: error: unsupported option '-fopenmp' make: *** [.depend] Error 1
So it did not work. I guess there are other issues?
Thanks for the reply
@AndreaYCT
This is a problem with the version of HDF5 as the FTP site hosting the bundled file will cleanup files and remove older versions. To fix this, you can go into the
Makefile
and edit line 31: (https://github.com/jts/nanopolish/blob/9d6590a0d2fd818e0fa0edbd82c824d6a7242f7c/Makefile#L31
And change it to
HDF5_VERSION ?= 1.13.3
@AndreaYCT
This is a problem with the version of HDF5 as the FTP site hosting the bundled file will cleanup files and remove older versions. To fix this, you can go into the
Makefile
and edit line 31: (https://github.com/jts/nanopolish/blob/9d6590a0d2fd818e0fa0edbd82c824d6a7242f7c/Makefile#L31
And change it to
HDF5_VERSION ?= 1.13.3
Hi @AndreaYCT
Did you checkout the build specifically for apple silicon? As per your listed steps, you'll need to include a step to checkout the m1-build
branch as shown below:
git clone --recursive https://github.com/jts/nanopolish.git
cd nanopolish
git checkout m1-build
nano Makefile
@rdeborja ,
Thanks for the detail. I'll try now. On the other hand, i found the installation of eigen is different from MAKEFILE. Will it be the problem too?
Manual of eigen:
$ wget https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
$ tar -xzvf eigen-3.3.7.tar.gz
Hi @AndreaYCT
Did you checkout the build specifically for apple silicon? As per your listed steps, you'll need to include a step to checkout the
m1-build
branch as shown below:git clone --recursive https://github.com/jts/nanopolish.git cd nanopolish git checkout m1-build nano Makefile
Hi, @rdeborja
I got same error.
if [ ! -e 3.3.7.tar.bz2 ]; then \ wget https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.bz2; \ fi --2024-04-03 11:11:33-- https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.bz2 Resolving gitlab.com (gitlab.com)... 172.65.251.78 Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/octet-stream] Saving to: ‘eigen-3.3.7.tar.bz2’
eigen-3.3.7.tar.bz2 [ <=> ] 1.59M --.-KB/s in 0.1s
2024-04-03 11:11:34 (11.4 MB/s) - ‘eigen-3.3.7.tar.bz2’ saved [1663474]
tar -xjf eigen-3.3.7.tar.bz2 || exit 255 mv eigen-3.3.7 eigen || exit 255 rm -f ./.depend c++ -g -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/include -L/usr/lib -std=c++11 -fopenmp -fsigned-char -D_FILE_OFFSET_BITS=64 -I./include -I./htslib -I./minimap2 -I./fast5/include -I./src -I./src/hmm -I./src/thirdparty -I./src/thirdparty/scrappie -I./src/common -I./src/alignment -I./src/pore_model -I./src/io -I./eigen/ -I./slow5lib/include/ -MM src/nanopolish_call_methylation.cpp src/nanopolish_call_variants.cpp src/nanopolish_detect_polyi.cpp src/nanopolish_fast5_check.cpp src/nanopolish_getmodel.cpp src/nanopolish_haplotype.cpp src/nanopolish_index.cpp src/nanopolish_methyltrain.cpp src/nanopolish_phase_reads.cpp src/nanopolish_polya_estimator.cpp src/nanopolish_raw_loader.cpp src/nanopolish_read_db.cpp src/nanopolish_scorereads.cpp src/nanopolish_squiggle_read.cpp src/nanopolish_train_poremodel_from_basecalls.cpp src/nanopolish_variant_db.cpp src/nanopolish_vcf2fasta.cpp src/training_core.cpp src/hmm/nanopolish_duration_model.cpp src/hmm/nanopolish_profile_hmm.cpp src/hmm/nanopolish_profile_hmm_r7.cpp src/hmm/nanopolish_profile_hmm_r9.cpp src/hmm/nanopolish_transition_parameters.cpp src/common/fs_support.cpp src/common/logsum.cpp src/common/nanopolish_alphabet.cpp src/common/nanopolish_bam_processor.cpp src/common/nanopolish_bam_utils.cpp src/common/nanopolish_common.cpp src/common/nanopolish_iupac.cpp src/common/nanopolish_klcs.cpp src/common/nanopolish_variant.cpp src/alignment/nanopolish_alignment_db.cpp src/alignment/nanopolish_anchor.cpp src/alignment/nanopolish_eventalign.cpp src/pore_model/nanopolish_model_names.cpp src/pore_model/nanopolish_pore_model_set.cpp src/pore_model/nanopolish_poremodel.cpp src/io/nanopolish_fast5_io.cpp src/io/nanopolish_fast5_loader.cpp src/io/nanopolish_fast5_processor.cpp src/thirdparty/fet.c src/thirdparty/stdaln.c src/thirdparty/scrappie/event_detection.c src/thirdparty/scrappie/scrappie_common.c > ./.depend; clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' [-Wmissing-sysroot] clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' make: *** [.depend] Error 1
Hi @AndreaYCT
Did you checkout the build specifically for apple silicon? As per your listed steps, you'll need to include a step to checkout the
m1-build
branch as shown below:git clone --recursive https://github.com/jts/nanopolish.git cd nanopolish git checkout m1-build nano Makefile
Hello,
I am trying to compile Nanopolish on Apple silicon. I use the following commands:
For both x86_64 and arm64 it gives me the following error:
I would like to at least be able to compile it for arm64. Can anybody help me?