#python #git #jupyter-notebook #anaconda
#питон #git #jupyter-записная книжка #анаконда
Вопрос:
Я установил Anaconda и вместе с ним установил Git Bash для запуска команд через bash. После установки Anaconda и добавления каталогов в переменную PATH я не смог запустить Jupyter notebook из Git Bash. Он выдает следующую ошибку.
jupyter notebook
_cffi_ext.c
anaconda3libsite-packageszmqbackendcffi__pycache___cffi_ext.c(268): fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
Traceback (most recent call last):
File "C:UsersFalleanaconda3Scriptsjupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:UsersFalleanaconda3libsite-packagesnotebooknotebookapp.py", line 51, in <module>
from zmq.eventloop import ioloop
File "C:UsersFalleanaconda3libsite-packageszmq__init__.py", line 50, in <module>
from zmq import backend
File "C:UsersFalleanaconda3libsite-packageszmqbackend__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:UsersFalleanaconda3libsite-packageszmqutilssixcerpt.py", line 34, in reraise
raise value
File "C:UsersFalleanaconda3libsite-packageszmqbackend__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:UsersFalleanaconda3libsite-packageszmqbackendselect.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:UsersFalleanaconda3libsite-packageszmqbackendcython__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.
После того, как я получил сообщение об ошибке, я проверил версию на Jupyter, чтобы узнать, не отключено ли что-то. И вот что я получил
$ jupyter --version
_cffi_ext.c
anaconda3libsite-packageszmqbackendcffi__pycache___cffi_ext.c(268): fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
_cffi_ext.c
anaconda3libsite-packageszmqbackendcffi__pycache___cffi_ext.c(268): fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
_cffi_ext.c
anaconda3libsite-packageszmqbackendcffi__pycache___cffi_ext.c(268): fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
_cffi_ext.c
anaconda3libsite-packageszmqbackendcffi__pycache___cffi_ext.c(268): fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
jupyter core : 4.6.3
jupyter-notebook : 6.1.4
qtconsole : 4.7.7
ipython : 7.19.0
ipykernel : not installed
jupyter client : not installed
jupyter lab : 2.2.6
nbconvert : not installed
ipywidgets : not installed
nbformat : 5.0.8
traitlets : 5.0.5
Я попытался установить следующие пакеты, но в нем указано, что все запрошенные пакеты уже установлены (используется conda install, а не pip)
Я опубликовал изображение списка моей переменной PATH.
Ответ №1:
Похоже, что-то повредило jupyter
среду.
Для меня это сработало после переустановки с:
pip install jupyter
Я не могу установить pyzmq на моем macbook (OSX 10.9.1)
Первый вызов должен был запускаться:
sudo pip install pyzmq
Произошла ошибка, из-за которой libzmq не удалось найти, и, похоже, попытался скомпилировать связанную версию:
[email protected]:~ $ sudo pip install pyzmq
Password:
Downloading/unpacking pyzmq
Downloading pyzmq-14.0.1.tar.gz (867kB): 867kB downloaded
Running setup.py egg_info for package pyzmq
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no directories found matching 'bundled/uuid'
warning: no previously-included files found matching 'bundled/uuid/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/platform.hpp'
warning: no previously-included files found matching 'setup.cfg'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
Installing collected packages: pyzmq
Running setup.py install for pyzmq
Did not find libzmq via pkg-config:
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -c build/temp.macosx-10.8-x86_64-2.7/scratch/check_sys_un.c -o build/temp.macosx-10.8-x86_64-2.7/scratch/check_sys_un.o
xcrun clang -undefined dynamic_lookup build/temp.macosx-10.8-x86_64-2.7/scratch/check_sys_un.o -o build/temp.macosx-10.8-x86_64-2.7/scratch/check_sys_un
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir:
************************************************
xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.macosx-10.8-x86_64-2.7/scratch/vers.c -o build/temp.macosx-10.8-x86_64-2.7/scratch/vers.o
build/temp.macosx-10.8-x86_64-2.7/scratch/vers.c:4:10: fatal error: 'zmq.h' file not found
#include "zmq.h"
^
1 error generated.
error: command 'xcrun' failed with exit status 1
Failed with default libzmq, trying again with /usr/local
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: /usr/local
************************************************
xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.macosx-10.8-x86_64-2.7/scratch/vers.c -o build/temp.macosx-10.8-x86_64-2.7/scratch/vers.o
build/temp.macosx-10.8-x86_64-2.7/scratch/vers.c:4:10: fatal error: 'zmq.h' file not found
#include "zmq.h"
^
1 error generated.
error: command 'xcrun' failed with exit status 1
Warning: Failed to build or run libzmq detection test.
If you expected pyzmq to link against an installed libzmq, please check to make sure:
* You have a C compiler installed
* A development version of Python is installed (including headers)
* A development version of ZMQ >= 2.1.4 is installed (including headers)
* If ZMQ is not in a default location, supply the argument --zmq=<path>
* If you did recently install ZMQ to a default location,
try rebuilding the ld cache with `sudo ldconfig`
or specify zmq location with `--zmq=/usr/local`
If you expected to get a binary install (egg), we have those for
current Pythons on OS X and Windows. These can be installed with
easy_install, but PIP DOES NOT SUPPORT EGGS.
You can skip all this detection/waiting nonsense if you know
you want pyzmq to bundle libzmq as an extension by passing:
`--zmq=bundled`
I will now try to build libzmq as a Python extension
unless you interrupt me (^C) in the next 10 seconds...
************************************************
1...
Using bundled libzmq
already have bundled/zeromq
attempting ./configure to generate platform.hpp
Warning: failed to configure libzmq:
/bin/sh: ./configure: No such file or directory
staging platform.hpp from: buildutils/include_darwin
************************************************
cc -c /tmp/crypto_box_keypairpmO9ft.c -o build/temp.macosx-10.8-x86_64-2.7/tmp/crypto_box_keypairpmO9ft.o
/tmp/crypto_box_keypairpmO9ft.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/tmp/crypto_box_keypairpmO9ft.c:2:5: warning: implicit declaration of function 'crypto_box_keypair' is invalid in C99 [-Wimplicit-function-declaration]
crypto_box_keypair();
^
2 warnings generated.
cc build/temp.macosx-10.8-x86_64-2.7/tmp/crypto_box_keypairpmO9ft.o -lsodium -o build/temp.macosx-10.8-x86_64-2.7/a.out
ld: library not found for -lsodium
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Warning: libsodium not found, zmq.CURVE security will be unavailable
************************************************
building 'zmq.libzmq' extension
xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibundled/zeromq/include -Ibundled -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c buildutils/initlibzmq.c -o build/temp.macosx-10.8-x86_64-2.7/buildutils/initlibzmq.o
...
... (lots more compiling)
...
xcrun clang -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk build/temp.macosx-10.8-x86_64-2.7/zmq/backend/cython/utils.o -o build/lib.macosx-10.8-x86_64-2.7/zmq/backend/cython/utils.so
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no directories found matching 'bundled/uuid'
warning: no previously-included files found matching 'bundled/uuid/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'setup.cfg'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
Successfully installed pyzmq
Cleaning up...
Это не сработало:
[email protected]:~ $ python
Python 2.7.3 (default, Mar 15 2013, 22:53:11)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zmq
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/zmq/__init__.py", line 35, in <module>
_libzmq = ctypes.CDLL(bundled[0], mode=ctypes.RTLD_GLOBAL)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/python2.7/site-packages/zmq/libzmq.so, 10): Symbol not found: __ZNSiD0Ev
Referenced from: /usr/local/lib/python2.7/site-packages/zmq/libzmq.so
Expected in: flat namespace
in /usr/local/lib/python2.7/site-packages/zmq/libzmq.so
>>>
Поэтому я интерпретировал ошибки в процессе установки как не имеющие libzmq. Следуя инструкциям https://github.com/zeromq/pyzmq/wiki/Building-and-Installing-PyZMQ, я удалил его и попытался:
[email protected]:~ $ brew install zeromq
==> Downloading http://download.zeromq.org/zeromq-3.2.3.tar.gz
######################################################################## 100.0%
==> Patching
patching file tests/test_disconnect_inproc.cpp
==> ./configure --prefix=/usr/local/Cellar/zeromq/3.2.3
==> make
==> make install
==> Caveats
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine,
you may need to do:
ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq
==> Summary
/usr/local/Cellar/zeromq/3.2.3: 54 files, 2.4M, built in 52 seconds
Далее следуют:
[email protected]:~ $ sudo pip install pyzmq
Password:
Downloading/unpacking pyzmq
Running setup.py egg_info for package pyzmq
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no directories found matching 'bundled/uuid'
warning: no previously-included files found matching 'bundled/uuid/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'setup.cfg'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
Installing collected packages: pyzmq
Running setup.py install for pyzmq
Using bundled libzmq
already have bundled/zeromq
already have platform.hpp
************************************************
cc -c /tmp/crypto_box_keypairLbTEQR.c -o build/temp.macosx-10.8-x86_64-2.7/tmp/crypto_box_keypairLbTEQR.o
/tmp/crypto_box_keypairLbTEQR.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/tmp/crypto_box_keypairLbTEQR.c:2:5: warning: implicit declaration of function 'crypto_box_keypair' is invalid in C99 [-Wimplicit-function-declaration]
crypto_box_keypair();
^
2 warnings generated.
cc build/temp.macosx-10.8-x86_64-2.7/tmp/crypto_box_keypairLbTEQR.o -lsodium -o build/temp.macosx-10.8-x86_64-2.7/a.out
ld: library not found for -lsodium
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Warning: libsodium not found, zmq.CURVE security will be unavailable
************************************************
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no directories found matching 'bundled/uuid'
warning: no previously-included files found matching 'bundled/uuid/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'setup.cfg'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
Successfully installed pyzmq
Cleaning up...
Я продолжаю получать ошибку:
>>> import zmq
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/zmq/__init__.py", line 35, in <module>
_libzmq = ctypes.CDLL(bundled[0], mode=ctypes.RTLD_GLOBAL)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/python2.7/site-packages/zmq/libzmq.so, 10): Symbol not found: __ZNSiD0Ev
Referenced from: /usr/local/lib/python2.7/site-packages/zmq/libzmq.so
Expected in: flat namespace
in /usr/local/lib/python2.7/site-packages/zmq/libzmq.so
Независимо от того, что я делаю.
Я только что установил библиотеку ZMQ через brew, и я могу видеть файлы в / usr / local / include и / usr / local / bin, однако, когда я добавляю эти пути в путь поиска по заголовку и путь поиска библиотеки в XCode, я не могу используйте #include, поскольку он продолжает говорить мне, что не может найти находку.
Даже когда я добавляю /usr/local/Cellar/zeromq/4.1.4/include (где установлена настоящая библиотека) в путь поиска по заголовку, он все равно не найдет zmq.h, даже если там есть файл.
Что я должен делать?
Редактировать:
Полный исходный код — это просто пример файла из ZMQ themselfe,
//
// Hello World client in C++
// Connects REQ socket to tcp://localhost:5555
// Sends "Hello" to server, expects "World" back
//
#include <zmq.h>
#include <string>
#include <iostream>
int main ()
{
// Prepare our context and socket
zmq::context_t context (1);
zmq::socket_t socket (context, ZMQ_REQ);
std::cout << "Connecting to hello world server…" << std::endl;
socket.connect ("tcp://localhost:5555");
// Do 10 requests, waiting each time for a response
for (int request_nbr = 0; request_nbr != 10; request_nbr++) {
zmq::message_t request (5);
memcpy (request.data (), "Hello", 5);
std::cout << "Sending Hello " << request_nbr << "…" << std::endl;
socket.send (request);
// Get the reply.
zmq::message_t reply;
socket.recv (&reply);
std::cout << "Received World " << request_nbr << std::endl;
}
return 0;
}
Точная ошибка простолексическая проблема или проблема препроцессора, файл ‘zmq.h’ не найден main.cpp«
CompileC /Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/Objects-normal/x86_64/main.o ndovTest/main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/zezioen/stack/Projecten/CPP/ndovTest
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu++11 -stdlib=libc++ -fmodules -gmodules -fmodules-cache-path=/Users/zezioen/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/zezioen/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.11 -g -fvisibility-inlines-hidden -Wno-sign-conversion -I/Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/ndovTest.hmap -I/Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Products/Debug/include -Iusr/local/include -I/Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/DerivedSources/x86_64 -I/Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/DerivedSources -F/Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Products/Debug -MMD -MT dependencies -MF /Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/Objects-normal/x86_64/main.d --serialize-diagnostics /Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/Objects-normal/x86_64/main.dia -c /Users/zezioen/stack/Projecten/CPP/ndovTest/ndovTest/main.cpp -o /Users/zezioen/Library/Developer/Xcode/DerivedData/ndovTest-bktygajikpscajfbqwlwhyjknvzq/Build/Intermediates/ndovTest.build/Debug/ndovTest.build/Objects-normal/x86_64/main.o
/Users/zezioen/stack/Projecten/CPP/ndovTest/ndovTest/main.cpp:6:10: fatal error: 'zmq.h' file not found
#include <zmq.h>
^
1 error generated.
Изменить 2:
Я понятия не имею, что произошло, но я просто заново создал весь проект, выполнил те же самые шаги, что и раньше, и теперь он компилируется и запускается так, как должен.
Проект, который я использовал, был некоторое время назад, поэтому, возможно, было что-то еще, что вызывало проблемы.
0
Решение
Проверьте свою конфигурацию сборки на «Путь поиска» -> «Всегда искать пути пользователя», и под названием вашего проекта следует сказать «да»
0
Другие решения
Других решений пока нет …
-
Summary
-
Files
-
Reviews
-
Support
-
Home
-
Tickets
-
Discussion
-
Code
-
Wiki
Menu
▾
▴
Great design and great library ZeroMQ
Created:
2019-04-30
Updated:
2019-05-23
-
Hi everyone! I want to say thanks to the authors of the 0MQ library under LabVIEW! It is really a very flexible tool! I have studied and checked almost all patterns, everything works well. However, I have a question: do you plan to release a library that will support UDP sockets?(UDP transport can only be used with the ZMQ_RADIO and ZMQ_DISH socket types)
Best regards,
Victor Sm.
-
Hi, glad to hear the library has been useful to you!
My understanding is that RADIO and DISH types are presently still in DRAFT status, although they are included in the most recent stable release so I don’t see why they couldn’t be used. Didn’t seem like a lot of work, so I went ahead and did it.
I bumped the library to 4.3.1-stable with drafts enabled so support is there, and added the required extra functionality since messages must be marked with a group (annoyingly the doco doesn’t exist so I followed the libzmq test case). I put an example in tests/ that seems to work fine.
You can grab the update from the code repo; if it works for you as well then I’ll package up a release.
-
Martijn Jasperse, thanks for the quick response! I have a question: if I download updates from the repository — it will not break my current projects on an older version of the library? Yes, the library is really usefull. I learned about the technology from network technology programmers. They use it for a long time and they like it. To expand the use of LabVIEW found Your solution. After a series of tests, we were convinced of the functionality of the library in LabVIEW. At the moment I have developed several projects that support dozens of sockets with different patterns. Using ZeroMQ I was able to run my application on several computers at the same time. This frees network developers to create a multitasking server on their own(as is done in TCP/IP). In the future, I want to check the work of the library on Linux for inter-process exchange. Have you checked? Did everything work for you? I mean Linux.
-
Updaing the library shouldn’t break anything significant- I had to add a terminal to the zmq_send VI which means you’ll have to relink any VIs that call that one directly, but this is a quick process. There have been no major changes since the last release.
The library has previously been debugged and used for LabVIEW Linux, although it has been some time since that was last tested. I have not tested it with the IPC protocol but I don’t forsee any problems. I think there is scope to get that working within the next month.
-
Martijn Jasperse, thank you very much! I copied the files you added/updated to the repository. Everything works fine for me. As I can see, you have added other patterns(not only DISH-RADIO). That’s good! I hope that soon I will be able to test the novelties of this release.
Best regards,
Victor Sm.
-
I’ve tested building on Linux and with a few minor fixes (now in the repo) it seems to work fine. Previous users have also reported it working on cRIO so it should be fine. If you encounter any specific issues please lodge a bug report.
-
Martijn Jasperse , I don’t see in the repository .so libraries for zeroMQ. You have posted a library for Windows. I have no opportunity now to collect the project and to compile libraries under Linux. Can You add them please? Expansion .so
Thanks you so much!-
Shared Objects are not like DLLs; the Linux way is to recompile on your host system as per your host dependencies. I think it is unlikely this will work by just using the binary built on my system but you can try regardless.
-
I use 64-bit openSUSE and LabVIEW 2014 x64. I tried to compile the so-file with the command: gcc -shared -o lvzmq64.so zmq_labview.c. I get error: fatal error zmq.h : #include <zmq.h> not found. Is there any description of how to build to get .so? May be you know a way with use dll x64 under linux? I think this bad idea, but… Thank’s so much for your help!</zmq.h>
Last edit: Smychenko Victor 2019-05-20
-
No you cannot use the DLL under Linux. You have to build your own SO and you need some familiarity with the make process for that. Evidently you do not have the zmq devel headers installed on your build system. I am cannot test x64 Linux myself and NI have released very little information on this platform’s internals so I do not know if it will work. I suggest reading up on building shared libraries.
-
Yes, you’re right. I installed zmq devel headers and I don’t get this error anymore. However, I have difficulties in further actions. Can You give a link to the further algorithm of actions? As far as I understand, to build under Linux I have to make changes to the source file for zm_labview.c ? Previously, I thought it was a little easier…
-
Martijn Jasperse , I tried using the Makefile you kindly provided with the library. However, I have a problem. I can’t find the right #include <extcode.h>. Could you help with that? I think I’m missing this file as well as possible other dependencies. I do not understand how to compile Your library with other people, and why nobody shared algoritma step by step. Perhaps it’s too easy, but for beginners in Linux it would be very convenient. I’m install LabVIEW 2014 x32 , OS OpenSuse x64. Thanks for help!</extcode.h>
upd: I copied file from /usr/local/natinst/LabVIEW-2014/cintools/: extcode.h, fundtypes.h, lv_epilog.h, lv_prolog.h, platdefines.h and moved this file into /usr/include under linux. But I get more warnings and finaly Error 1. But I don’t have this file in my build folder before assembly(use make). I checked. As he emerges? I tried to use it, but LabVIEW says that it is impossible to call this file.
Look is it:
make -f makefile
cc -shared -o ../lvzmq32.so zmq_labview.c -DZMQ_BUILD_DRAFT_API -Wall -O3 -fpic -pthread -I /usr/local/natinst/LabVIEW-2014/cintools -L /usr/local/natinst/LabVIEW-2014/cintools -lzmq -llvrt
zmq_labview.c: In function ‘lvzmq_close’:
zmq_labview.c:108:11: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
int ret, i; void sock;
^
zmq_labview.c: In function ‘lvzmq_ctx_create_reserve’:
zmq_labview.c:221:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
pinstdata = bonzai_init(( void )ninits );
^
zmq_labview.c: In function ‘lvzmq_send’:
zmq_labview.c:464:2: warning: implicit declaration of function ‘zmq_msg_set_group’ [-Wimplicit-function-declaration]
if ( group && group ) zmq_msg_set_group( &msg, group );
^
zmq_labview.c: In function ‘lvzmq_receiver_thread’:
zmq_labview.c:581:11: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int ret, err;
^
zmq_labview.c: In function ‘lvzmq_join’:
zmq_labview.c:828:2: warning: implicit declaration of function ‘zmq_join’ [-Wimplicit-function-declaration]
ret = zmq_join( s->sock, group );
^
zmq_labview.c: In function ‘lvzmq_leave’:
zmq_labview.c:836:2: warning: implicit declaration of function ‘zmq_leave’ [-Wimplicit-function-declaration]
ret = zmq_leave( s->sock, group );
^
cp: «../lvzmq32.so» and «/usr/local/natinst/LabVIEW-2014/vi.lib/addons/zeromq/lvzmq32.so» — The same file
make: *** [all] Error1Last edit: Smychenko Victor 2019-05-22
-
The warnings indicate that the version of libzmq you have installed was not built with the draft APIs enabled. Remember, the RADIO/DISH pattern is not included in the standard release yet, which is why ZMQ_BUILD_DRAFT_API is required. The compiler complaining about implicit declarations means they were not built in the version you have installed (probably the openSUSE default). Try downloading a compatible binary release from http://zeromq.org/intro:get-the-software (with DRAFT APIs)
I don’t see a great way to detect whether the installed version has the required functions available but maybe I can think of something.
Log in to post a comment.