SolaceSamples / solace-samples-c

Getting Started Samples for the Solace C API.
http://dev.solace.com/get-started/c-tutorials/
Apache License 2.0
22 stars 21 forks source link

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

Open solace-brendabutler opened 1 month ago

solace-brendabutler commented 1 month ago

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 commented 1 month ago

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]$
Mrc0113 commented 1 month ago

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.

solace-brendabutler commented 1 month ago

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.