I start in the Vim src directory
$ pwd
~/vim/src
$ ./configure \
> --prefix=$HOME/Applications/vim-compiled \
> --enable-rubyinterp=yes \
> --enable-pythoninterp=yes \
> --with-python-config-dir=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
$ make
At the end of make, I get the following error
ld: warning: in /Library/Frameworks//Python.framework/Python, missing required architecture x86_64 in file
Undefined symbols:
<very long list of Undefined symbols>
...
...
...
<very long list of Undefined symbols>
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [vim] Error 1
What's causing the error? I've found answers in similar questions that advise using MacPorts, Homebrew, or MacVim. I don't want to use any of those. Is there some other way around?
UPDATE: This is the output listing the Undefined symbols http://pastebin.com/ggV87ReF
In my case I've installed MacVim on 10.6.8 using the following command
./configure --prefix=/usr --enable-perlinterp=yes --enable-pythoninterp=yes --with-features=huge --with-python-config-dir=/System/Library/Frameworks/Python.framework/Versions/2.6
sudo make
Have you tried upgrading to the OSX 32-bit/64-bit version of Python 2.7.2? I'm not sure if there was a specific 64-bit version of 2.7, and that might be causing problems.
Take a look at the Homebrew recipe for vim (or macvim) and modify it if necessary. https://github.com/mxcl/homebrew
Related
For some bizzare reason when I re-logged in to the cluster/HPC I used the conda, activate and deactivate commands stopped working. I printed the place where they'd be but they weren't there but isntead the .c~ file was there and not the bin anymore:
brando9~/miniconda/bin $ ls
2to3 certtool c_rehash genrb img2webp lzfgrep pip3.10 raw2tiff tiffcp unzstd xzegrep
2to3-3.9 chardetect cwebp gif2rgb infocmp lzgrep pip3.9 rdjpgcom tiffcrop wandb xzfgrep
activate.c cjpeg deactivate.c gif2webp infotocap lzless pkcs1-conv reset tiffdither wb xzgrep
bsdcat clear derb gifbuild jpegtran lzma pkgdata rg tiffdump webpinfo xzless
bsdcpio conda-build djpeg gifclrmp jpgicc lzmadec pkginfo sexp-conv tiffinfo webpmux xzmore
bsdtar conda.c~ dwebp giffix lame lzmainfo pngfix shortuuid tiffmedian wish zstd
bunzip2 conda-convert f2py giftext libdeflate-gunzip lzmore png-fix-itxt sqlite3 tiffset wish8.6 zstdcat
bzcat conda-debug f2py3 giftool libdeflate-gzip makeconv ppm2tiff sqlite3_analyzer tiffsplit wrjpgcom zstdgrep
bzcmp conda-develop f2py3.9 gnutls-cli libpng16-config ncursesw6-config psicc srptool tificc x86_64-conda_cos7-linux-gnu-ld zstdless
bzdiff conda-env.c~ fax2ps gnutls-cli-debug libpng-config nettle-hash psktool tabs toe x86_64-conda-linux-gnu-ld zstdmt
bzegrep conda-index fax2tiff gnutls-serv linkicc nettle-lfib-stream pydoc tclsh torchrun xml2-config
bzfgrep conda-inspect ffmpeg h264dec lz4 nettle-pbkdf2 pydoc3 tclsh8.6 tput xmlcatalog
bzgrep conda-metapackage ffprobe h264enc lz4c normalizer pydoc3.9 tic tqdm xmllint
bzip2 conda-render freetype-config iconv lz4cat ocsptool python tiff2bw transicc xz
bzip2recover conda-skeleton genbrk icu-config lzcat openssl python3 tiff2pdf tset xzcat
bzless convert-caffe2-to-onnx gencfu icuinfo lzcmp pal2rgb python3.9 tiff2ps unlz4 xzcmp
bzmore convert-onnx-to-caffe2 gencnval idle3 lzdiff patch python3.9-config tiff2rgba unlzma xzdec
captoinfo cph gendict idle3.9 lzegrep patchelf python3-config tiffcmp unxz xzdiff
I tried renaming the file to remove the tilde ~ and recompiling it with gcc -Wall activate.c -o activate for each of the three c files but it failed with this msg:
brando9~/miniconda/bin $ gcc -Wall activate.c -o activate
activate.c:1:2: error: invalid preprocessing directive #!
#!/bin/sh
^
activate.c:2:1: warning: data definition has no type or storage class
_CONDA_ROOT="/dfs/scratch0/brando9/miniconda"
^
activate.c:2:1: warning: type defaults to ‘int’ in declaration of ‘_CONDA_ROOT’ [-Wimplicit-int]
activate.c:3:3: error: invalid preprocessing directive #Copyright
# Copyright (C) 2012 Anaconda, Inc
^
activate.c:4:3: error: invalid preprocessing directive #SPDX
# SPDX-License-Identifier: BSD-3-Clause
^
activate.c:5:1: error: stray ‘\’ in program
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
^
activate.c:5:4: error: expected identifier before string constant
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
^
I tried catting the install .sh file I used with wget wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh but the output was unreadable:
...
m�gI���w%��.{=[��M7O�<��R��yj#���#K��r�q�m���V)=��O���?�˳�����MU���i2|I%�D�h�E:���/C� �l>��pD�Y����w��i#��X�eT��eҠ����Grq����X*9l���dW
�~����q�NyF?�_EbE��׳B&���>�Kw5nZ!~ʒ6m�ˡ�����ǟ�� �nX�г]1��R���S 3�}��<Z���En%'��tS�}�;�G7sFi�[��N3�W34<>[�h����M~�1�T�� {&��>H:�Eo �~��Pp�*��%�Օ� �d��H�W��H�7����~h�2�V[Iў��5O�H&�\�u�
u�ZD��Y[d�
��s*�%�u�j� y\AB����� ��qnm/5��j#k����<Z�s3�y*�i����NO�4&��~�邲�W�S��גDY��{�G���8�[���H�?��������H�e+ix�16-�yYI�܉{�j2��P�D�����ڬ��k^��=M��+ɓ�_p�!����k+!�U���B[nj�]nL�
�/5�5X&��0*:�{�=SJ\I�Z}�;?�d��6�[/�JOn'��G����X���5J���K�P��6>e�!����`*���ěX2ؓ�3��h!�#�qП�R}P�1�ï�)=�U¶#|�G�^C
at which point I decided I had no idea what happened or what to fix it. Of course my path is fine as other question on SO suggest to fix Conda command not found. At this point I decided I have no idea what happened or how to fix it anymore. Any help that doesn't require an hour long re-install of conda?
related:
cross https://www.reddit.com/r/learnmachinelearning/comments/yrt9yf/how_do_i_re_compile_the_conda_activate_and/
other post that didn't help How to run Conda?
google groups: https://groups.google.com/a/anaconda.com/g/anaconda/c/DpdjFjlj0wg
quora: https://www.quora.com/unanswered/How-do-I-re-compile-the-conda-activate-and-deactivate-commands-in-miniconda
conda gitissue: https://github.com/conda/conda/issues/12086
The bin/activate and bin/deactivate files have never been binaries, but rather simple shell scripts. The situation described seems to indicate somehow a .c was appended to the file names. Looks like you could simply rename them (remove the .c) and they would go back to normal functionality.
For reference, here is my version:
$ cat ${CONDA_PREFIX}/bin/activate
#!/bin/sh
_CONDA_ROOT="/Users/mfansler/mambaforge-arm64"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
conda activate "$#"
which essentially looks identical (up to paths), to what gcc emits in OP as the lines of the activate.c file.
However, I'd note that using bin/activate is outmoded, AFAIK. Since Conda v4.6, conda (de|)activate have been shell functions defined by conda shell.posix hook. The code in the bin/activate file is a recapitulation of what is already provided in the user shell after running conda init once (usually at installation time).
I encounter a problem on using the matplotlib-cpp in MacOS. Recently I download the matplotlibb-cpp into my macbook and try to run the sample code to see whether it works properly. I compile the sample code using
g++ test.cpp -std=c++17 \
-I /Users/pangkachun/matplotlib-cpp \
-I /Users/pangkachun/miniforge3/include/python3.9 \
-I /Users/pangkachun/miniforge3/lib/python3.9/site-packages/numpy/core/include \
-L /Users/pangkachun/miniforge3/lib \
-lpython3.9 \
-o plot
However, when I tried to execute the output file ./plot, I got an error message from terminal
dyld[47656]: Library not loaded: #rpath/libpython3.9.dylib
Referenced from: /Users/pangkachun/plot
Reason: tried: '/usr/local/lib/libpython3.9.dylib' (no such file), '/usr/lib/libpython3.9.dylib' (no such file)
zsh: abort ./plot
Could someone give me some guidelines on how to solve this problem?
""" Update"""
I use an alternative method to compile ./plot which symlink the miniforge3/lib that containing libpython3.9.dylib to /usr/local/lib. This /usrlocal/lib is created by my own under symlink. Although this works, I hope there is a "normal" method to deal with this issue.
I was trying to build uwsgi+django server. I need to build uwsgi python36_plugin.so for python3.6 using this command:
make PROFILE=nolang
PYTHON=python3 ./uwsgi --build-plugin "plugins/python python36"
It didn't work:
[root#izuf64a9gck81cz uwsgi-2.0.15]# PYTHON=python ./uwsgi --build-plugin "plugins/python python36"
*** uWSGI building and linking plugin from plugins/python ***
[gcc -pthread] python36_plugin.so
/usr/bin/ld: /usr/python3/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/python3/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
*** unable to build python36 plugin ***
When i use build python2.7 version,it turns out right
PYTHON=python2.7 ./uwsgi --build-plugin "plugins/python python27"
My problem is I have two version of python 3, the default python3 is python3.4, and the second one is python3.6, and I want to use python3.6 for some of my django project so I need to build the plugins and I got same problem you got.
It took me couple hours to solved this issue. Here is what I did from here:
Reconfigure my python3.6
cd Python-3.6.4/
./configure --enable-shared --enable-optimizations --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
Get in to your uwsgi folder and try to build again
PYTHON=python3.6 ./uwsgi --build-plugin "plugins/python python36"
Goodluck! May it solve your prob too!
Mac OS Sierra.
In terminal, while trying to execute a .sh file that involves a Python script with Fortran portions, I got this message:
lenscov-master Roger$ ./run_covariances.sh recompile
rm *.o *.so
rm: *.so: No such file or directory
make: [clean] Error 1 (ignored)
gfortran -fPIC -c *.f -lgfortran -lifcore
f2py-2.7 -c loop_lensing.f90 *.o -m loop_lensing --opt=-ffixed-line-length-
none --opt=-O3
/bin/sh: f2py-2.7: command not found
make: *** [loop_lensing] Error 127
However, it is fine just test-running the .f90 file:
f2py -c loop_lensing.F90 -m test
returns a bunch of normal-looking information.
Does anyone maybe know what is going on?
it is fine just test-running the .f90 file
means you have f2py installed. But the script use f2py-2.7
You need to check the version of installed f2py, and make sure f2py-2.7 redirects to the corrent f2py.
The script (or a Makefile) tries to invoke f2py-2.7 instead of f2py. If it is your script or you can easily adjust it, rename all f2py-2.7 to f2py. Otherwise you have to tell us more about the script and show the code of the script.
As foodtooth says, make sure you have f2py 2.7 and not f2py-3, but I don't expect that to be a problem.
You could also make a symlink f2py -> f2py-2.7 for the script.
I've been trying to install nodejs on my VPS for a little while now. Since I'm using CentOs 5.6 I had to build it from source.
More so I need the python 2.7 as the default python on my box was 2.4.
I compiled python from source and it was installed successfully in /usr/local/bin/python2.7.
Now the problem is upon issuing make in the nodejs directory it reaches the following exceptions.
.
.
.
LD_LIBRARY_PATH=/root/node/out/Release/lib.host:/root/node/out/Release/lib.tar
get:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p
/root/node/out/Release/obj/gen; python ../../tools/generate-trig-table.py "/root
/node/out/Release/obj/gen/trig-table.cc"
touch /root/node/out/Release/obj.host/deps/v8/tools/gyp/generate_trig_table.st
amp
LD_LIBRARY_PATH=/root/node/out/Release/lib.host:/root/node/out/Release/lib.tar
get:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p
/root/node/out/Release/obj/gen; python ../../tools/js2c.py "/root/node/out/Relea
se/obj/gen/libraries.cc" CORE off ../../src/runtime.js ../../src/v8natives.js ..
/../src/array.js ../../src/string.js ../../src/uri.js ../../src/math.js ../../sr
c/messages.js ../../src/apinatives.js ../../src/debug-debugger.js ../../src/mirr
or-debugger.js ../../src/liveedit-debugger.js ../../src/date.js ../../src/json.j
s ../../src/regexp.js ../../src/arraybuffer.js ../../src/typedarray.js ../../src
/weak_collection.js ../../src/promise.js ../../src/object-observe.js ../../src/m
acros.py
File "../../tools/js2c.py", line 387
except Error as e:
^
SyntaxError: invalid syntax
make[1]: *** [/root/node/out/Release/obj/gen/libraries.cc] Error 1
make[1]: Leaving directory `/root/node/out'
make: *** [node] Error 2
Somewhere I read that the Exception syntax has changed from python 2.6 up and I figured it must be using the old python so I did the following but it made no difference:
PYTHON=/usr/local/bin/python2.7
export PYTHON
python2.7 configure && make && make install
Now I'm wondering how should I proceed?
IMO you need to place python2.7 first in path and then run:
export PATH=/usr/local/bin:${PATH}
python2.7 configure && make && make install
If this does not work, probably one of the Python scripts is looking for python. You can probably fix that by symlinking python, something like:
mkdir /tmp/py27
ln -s /usr/local/bin/python2.7 /tmp/py27/python
export PATH=/tmp/py27:${PATH}
python configure && make && make install
Is all caps PYTHON a valid environment variable?
http://www.wellho.net/resources/ex.php4?item=y115/penv.py
I would think you would rather create a sym link to the correct python interpreter.
ln -s /usr/local/bin/python2.7 /usr/local/bin/python