IBMStreams/streamsx.hdfs

Makefile for samples need to work in both product and open-source

Closed this issue · 9 comments

Problem reported from Inet, but still valid here:

The Makefiles in $STREAMS_INSTALL/samples/com.ibm.streamsx.inet/HTTPStreamRead as well as the InetSource and InetSourceDynamicURL samples all use this definition to specify the location of the toolkit:

STREAMS_INET_TOOLKIT ?=../../com.ibm.streamsx.inet

However, the relative path to the toolkit from those directories is actually this:
../../../toolkits/com.ibm.streamsx.inet

So, "make" fails with the toolkit not being found.

toolkit path should be set to:
STREAMS_INET_TOOLKIT ?=../../com.ibm.streamsx.inet:${STREAMS_INSTALL}/toolkits/com.ibm.streamsx.inet

Why would that take the wrong toolkit version when run from open source? Maybe I missed something?

The toolkit path specifies that it will find the toolkit from ../../com.ibm.streamsx.inet first... and then from STREAMS_INSTALL. So, the one from open-source will always win.

For Studio, we do not want to use Makefile to build. We should use their internal builder... and will simplify the Makefile problem.

Sorry, I didn't read your suggested change carefully. Forget what I wrote.

As far as the studio issue, see IBMStreams/streamsx.inet #65 -- studio complains because the Makefile didn't work. Is that no longer a problem?

For Inet and Hbase, I fixed (without delivering to the master branch) with:

TOOLKIT_NAME=com.ibm.streamsx.inet
STREAMS_INET_TOOLKIT ?= $(shell  ([ -e ../../$(TOOLKIT_NAME) ] && echo ../../$(TOOLKIT_NAME)) ||\
([ -e "../com.ibm.streamsx.hbase" ] && echo ../$(TOOLKIT_NAME)) ||\
echo $(STREAMS_INSTALL)/toolkits/$(TOOLKIT_NAME))

If we are not to use Makefile to build in Studio, will my simpler solution work? This seems like a complicated solution...

I haven't tested it. But if it does work, then even if studio does invoke the Makefile, you could cover the usual case of someone importing all the projects from github into the same workspace with:
STREAMS_INET_TOOLKIT ?= ../com.ibm.streamsx.inet:../../com.ibm.streamsx.inet:$STREAMS_INSTALL/toolkits/com.ibm.streamsx.inet

Why is it that we have to specify inet twice:
../com.ibm.streamsx.inet:../com.ibm.streamsx.inet:?

Sorry, there was typo. I updated the comment.

Fixed and Merged.