Skip to content

Commit

Permalink
Problem: outof date with zproject
Browse files Browse the repository at this point in the history
Solution: regenerate it
  • Loading branch information
malanka committed Dec 7, 2016
1 parent d6c5ad2 commit e28c7d3
Show file tree
Hide file tree
Showing 16 changed files with 463 additions and 188 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# Select flags
SET(CMAKE_C_FLAGS_RELEASE "-O3")

# Will be used to add flags to pkg-config useful when apps want to statically link
set(pkg_config_libs_private "")

########################################################################
# options
########################################################################
Expand Down Expand Up @@ -83,6 +86,7 @@ find_package(libzmq REQUIRED)
IF (LIBZMQ_FOUND)
include_directories(${LIBZMQ_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES})
set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq")
ELSE (LIBZMQ_FOUND)
message( FATAL_ERROR "libzmq not found." )
ENDIF (LIBZMQ_FOUND)
Expand All @@ -94,6 +98,7 @@ find_package(czmq REQUIRED)
IF (CZMQ_FOUND)
include_directories(${CZMQ_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES})
set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq")
ELSE (CZMQ_FOUND)
message( FATAL_ERROR "czmq not found." )
ENDIF (CZMQ_FOUND)
Expand Down Expand Up @@ -149,7 +154,7 @@ if (NOT DEFINED BUILD_SHARED_LIBS)
endif()
add_library(mlm ${mlm_sources})
set_target_properties(mlm
PROPERTIES DEFINE_SYMBOL "LIBMLM_EXPORTS"
PROPERTIES DEFINE_SYMBOL "MLM_EXPORTS"
)
set_target_properties(mlm
PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${SOURCE_DIR}/src"
Expand Down Expand Up @@ -280,10 +285,6 @@ if(UNIX)
endif()

set(TEST_CLASSES
mlm_msg
mlm_stream_simple
mlm_mailbox_simple
mlm_mailbox_bounded
)

IF (ENABLE_DRAFTS)
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ RUN chmod 0440 /etc/sudoers.d/zmq
USER zmq

WORKDIR /home/zmq
RUN git clone --quiet https://github.com/zeromq/libzmq.git
WORKDIR /home/zmq/libzmq
RUN git clone --quiet https://github.com/zeromq/libzmq.git libzmq.git
WORKDIR /home/zmq/libzmq.git
RUN ./autogen.sh 2> /dev/null
RUN ./configure --quiet --without-docs
RUN make
RUN sudo make install
RUN sudo ldconfig

WORKDIR /home/zmq
RUN git clone --quiet https://github.com/zeromq/czmq.git
WORKDIR /home/zmq/czmq
RUN git clone --quiet https://github.com/zeromq/czmq.git czmq.git
WORKDIR /home/zmq/czmq.git
RUN ./autogen.sh 2> /dev/null
RUN ./configure --quiet --without-docs
RUN make
RUN sudo make install
RUN sudo ldconfig

WORKDIR /home/zmq
RUN git clone --quiet git://github.com/zeromq/malamute.git
WORKDIR /home/zmq/malamute
RUN git clone --quiet git://github.com/zeromq/malamute.git malamute.git
WORKDIR /home/zmq/malamute malamute.git
RUN ./autogen.sh 2> /dev/null
RUN ./configure --quiet --without-docs
RUN make
Expand Down
3 changes: 2 additions & 1 deletion bindings/jni/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
plugins {
id 'java'
id 'maven-publish'
id "com.jfrog.bintray" version "1.6"
id "com.jfrog.bintray" version "1.7.2"
}

group = "org.zeromq"
Expand Down Expand Up @@ -101,6 +101,7 @@ bintray {
key = System.getenv('BINTRAY_KEY')
publications = ['mavenJava']
publish = true
override = true
pkg {
repo = "maven"
name = "malamute-jni"
Expand Down
44 changes: 30 additions & 14 deletions bindings/python/malamute/_malamute_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,37 @@
import czmq

# malamute
lib = None
try:
# If LD_LIBRARY_PATH or your OSs equivalent is set, this is the only way to
# load the library. If we use find_library below, we get the wrong result.
if os.name == 'posix':
if sys.platform == 'darwin':
lib = cdll.LoadLibrary('libmlm.1.dylib')
else:
lib = cdll.LoadLibrary("libmlm.so.1")
elif os.name == 'nt':
lib = cdll.LoadLibrary('libmlm.dll')
except OSError:
libpath = find_library("malamute")
if not libpath:
raise ImportError("Unable to find libmlm")
lib = cdll.LoadLibrary(libpath)
# check to see if the shared object was embedded locally, attempt to load it
# if not, try to load it using the default system paths...
# we need to use os.chdir instead of trying to modify $LD_LIBRARY_PATH and reloading the interpreter
t = os.getcwd()
p = os.path.join(os.path.dirname(__file__), '..') # find the path to our $project_ctypes.py
os.chdir(p) # change directories briefly

from malamute import libmlm # attempt to import the shared lib if it exists
lib = CDLL(libmlm.__file__) # if it exists try to load the shared lib
os.chdir(t) # switch back to orig dir
except ImportError:
pass

if not lib:
try:
# If LD_LIBRARY_PATH or your OSs equivalent is set, this is the only way to
# load the library. If we use find_library below, we get the wrong result.
if os.name == 'posix':
if sys.platform == 'darwin':
lib = cdll.LoadLibrary('libmlm.1.dylib')
else:
lib = cdll.LoadLibrary("libmlm.so.1")
elif os.name == 'nt':
lib = cdll.LoadLibrary('libmlm.dll')
except OSError:
libpath = find_library("malamute")
if not libpath:
raise ImportError("Unable to find libmlm")
lib = cdll.LoadLibrary(libpath)

class mlm_proto_t(Structure):
pass # Empty - only for type checking
Expand Down
Loading

0 comments on commit e28c7d3

Please sign in to comment.