solace-samples-c icon indicating copy to clipboard operation
solace-samples-c copied to clipboard

[Bug]: build instructions build against bundled solclient 7.8, the latest C API is 7.30

Open solace-brendabutler opened this issue 1 year ago • 6 comments

Bug Description

Build instructions do not say how to update the API in solace-samples-c to the latest. The instructions will have the user build against the bundled CCSMP 7.8. Current version as of today is 7.30

Also the "tutorials" links under Contents ("tutorials home page") and under Running the Samples ("tutorials") are broken.

Expected Behavior

I expect to see instructions before the build (step 3) that say "put the API header files and the lib files , adjust the makefiles/env variables so the desired API is built/linked against".

Steps to Reproduce

Read the top-level README.md, the setenv.sh (build/intro/linux/x64/setenv.sh) and the Makefile (build/intro/linux/x64/Makefile). Also note the bundled version of the API here: lib/linux/x64/libsolclient_d.so.1.7.8.0.11

Solace Product

Solace APIs

Solace Broker version

No response

Solace API

C

Solace API version

7.30

solace-brendabutler avatar Aug 08 '24 20:08 solace-brendabutler

Here's a diff for the Makefile to show what I mean. It requires an extra environment variable that points to the top level of the unpacked CCSMP API. It has been tested against CCSMP 7.30.0.2, but probably doesn't work with the bundled CCSMP 7.8.

[user@host build]$ git diff
diff --git a/build/intro/linux/x64/Makefile b/build/intro/linux/x64/Makefile
index 616b408..936e670 100644
--- a/build/intro/linux/x64/Makefile
+++ b/build/intro/linux/x64/Makefile
@@ -7,16 +7,21 @@ CXX:=gcc -g
 ifeq ($(CCSMPHOME),)
        CCSMPHOME:=../../../..
 endif
+ifeq ($(CCSMPAPIHOME),)
+$(error Need to set CCSMPAPIHOME to point to where the API is)
+endif

-INCDIRS:=-I$(CCSMPHOME) \
-        -I$(CCSMPHOME)/inc \
-        -I.
+#INCDIRS:=-I$(CCSMPHOME) \
+#       -I$(CCSMPHOME)/inc \
+#       -I.
+INCDIRS:=-I. -I$(CCSMPAPIHOME)/include

 SIXTY_FOUR_COMPAT:=
 OS:=linux
 ARCH:=x64
-LINUXLIBDIR=$(CCSMPHOME)/lib/$(OS)/$(ARCH)
-LIBDIRS:=-L$(CCSMPHOME)/lib -L$(LINUXLIBDIR)
+#LINUXLIBDIR=$(CCSMPAPIHOME)/lib/$(OS)/$(ARCH)
+#LIBDIRS:=-L$(CCSMPAPIHOME)/lib  # -L$(LINUXLIBDIR)
+LIBDIRS:=-L$(CCSMPAPIHOME)/lib
 LLSYS:=$(SIXTY_FOUR_COMPAT)
 VPATH:=$(CCSMPHOME)/src/intro
 OUTPUTDIR:=$(CCSMPHOME)/bin
[user@host build]$

solace-brendabutler avatar Aug 08 '24 22:08 solace-brendabutler

I believe https://github.com/SolaceSamples/solace-samples-c/pull/44 addresses the old version of the API. Keeping this open to address:

Also the "tutorials" links under Contents ("tutorials home page") and under Running the Samples ("tutorials") are broken.

Mrc0113 avatar Aug 09 '24 18:08 Mrc0113

The issue is not so much that the bundled API is old, as it is that the instructions to use another version of the API are incomplete/wrong. It's OK to have a bundled API and have the build work for it - but we also need to be able to switch that out and use a current API. The new API must be referenced at compile time as well as run time. The instructions in the readme only reference the new API at run time. The diff I have provided does that for CCSMP 7.30. But it should be adjusted to work for both the old API and any new one.

solace-brendabutler avatar Aug 12 '24 14:08 solace-brendabutler

"But it should be adjusted to work for both the old API and any new one." and for Mac architecture.

solace-brendabutler avatar Sep 18 '24 20:09 solace-brendabutler

Hi @solace-brendabutler , how are you? The bundled libs and projects have now been updated. Please could you pull the latest and test again to see if the current addresses your issue? Then we can close this. Thanks!

aaron-613 avatar Oct 21 '24 13:10 aaron-613

Fixed in https://github.com/SolaceSamples/solace-samples-c/pull/44

aaron-613 avatar Oct 21 '24 16:10 aaron-613