Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on OSX #72

Merged
merged 3 commits into from
Feb 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ classes
deploy
Iskdaemon_admin
gwt-unitCache
.idea
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,34 @@ Key features:

# Install instructions

Installation, usage instructions and more details are available online at http://www.imgseek.net/isk-daemon/documents-1/install-and-usage
Installation, usage instructions and more details are available online at http://www.imgseek.net/isk-daemon/documents-1/install-and-usage [dead link]

Here are quick guide to build from cloned repo. You may want to ``sudo`` all this commands if you have permission errors.
I assume you know how to build from source and have all build tools and libraries installed for your system.

##Ubuntu Quick Start

This one is tested with Ubuntu 14.12

1. Install prerequisited if they're not on your system already:

``apt-get install swig ImageMagick libmagick++-dev python-dev``

2. cd to ./src and run: ``python setup.py install``

##MacOS Quick Start

1. Go to http://brew.sh and install ``Homebrew``

2. Install swig: ``brew install swig``

3. Install ImageMagick: ``brew install ImageMagick``

4. Install pkg-config: ``brew install pkg-config``

5. Cd to ./iskdaemon/src/ and run ``python setup.py install``

Alternatively, you can try it with ``macports``.

# Credits

Expand Down
2 changes: 1 addition & 1 deletion src/core/imgdbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
pbFactory = None # perspective factory
daemonStartTime = time.time()
hasShutdown = False
iskVersion = "0.9.3"
iskVersion = "0.9.5"

# misc daemon inits
rootLog = logging.getLogger('imgdbapi')
Expand Down
4 changes: 2 additions & 2 deletions src/imgSeekLib/imgdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ std::vector<double> queryImgID(const int dbId, long int id, int numres, int sket
long int sz = dbSpace[dbId]->sigs.size();
int_hashset includedIds;
sigIterator it = dbSpace[dbId]->sigs.begin();
for (int var = 0; var < min(sz, numres); ) { // var goes from 0 to numres
for (int var = 0; var < min<unsigned long>(sz, numres); ) { // var goes from 0 to numres
long int rint = rand()%(sz);
for(int pqp =0; pqp < rint; pqp++) {
it ++;
Expand Down Expand Up @@ -1313,7 +1313,7 @@ std::vector<double> queryImgIDKeywords(const int dbId, long int id, int numres,

vector<double> Vres;

for (int var = 0; var < min(V.size()/2, numres); ) { // var goes from 0 to numres
for (int var = 0; var < min<unsigned long>(V.size()/2, numres); ) { // var goes from 0 to numres
int rint = rand()%(V.size()/2);
if (V[rint*2] > 0) { // havent added this random result yet
Vres.insert(Vres.end(), V[rint*2] );
Expand Down
2 changes: 1 addition & 1 deletion src/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "isk-daemon"
!define PRODUCT_VERSION "0.9.3"
!define PRODUCT_VERSION "0.9.5"
!define PRODUCT_PUBLISHER "imgSeek"
!define PRODUCT_WEB_SITE "http://server.imgseek.net/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\isk-daemon.exe"
Expand Down
34 changes: 20 additions & 14 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# win/linux diffs
import os
import subprocess

# reuse README as package long description
with open('README.txt') as file:
Expand Down Expand Up @@ -46,28 +47,33 @@
# extra_compile_args += ["-DNeedFunctionPrototypes"]
# extra_compile_args += ["-D_DLL"]
extra_compile_args += ["-D_MAGICKMOD_"]
else: # *nix
else: # *nix
hasIMagick=0
extra_compile_args += [ "-DLinuxBuild","-g"]
extra_link_args += ["-g"]
print "#################################### Check ImageMagick"
try:
fnd=0
pathvar=os.environ["PATH"]
for pv in split(pathvar,':'):
if os.path.exists(pv+'/Magick++-config') or os.path.exists(pv+'Magick++-config'):
fnd=1
fnd = False
pathvar = os.environ["PATH"]
for pv in split(pathvar, ':'):
if os.path.exists(pv + '/Magick++-config') or os.path.exists(pv + 'Magick++-config'):
fnd = True
break # pv now holds directory in which Magick++-config was found
if fnd:
IMagCFlag=os.popen("Magick++-config --cxxflags --cppflags").read()
if find(IMagCFlag,"-I") != -1:
IMagCFlag=replace(IMagCFlag,"\n"," ")
IMagCFlag=split(IMagCFlag,' ')
IMagCLib=os.popen("Magick++-config --ldflags --libs").read()
IMagCLib=replace(IMagCLib,"\n"," ")
IMagCLib=split(IMagCLib,' ')
hasIMagick=1
#IMagCFlag = os.popen("Magick++-config --cxxflags --cppflags").read() # That's deprecated now
IMagCFlag = subprocess.check_output(["Magick++-config", "--cxxflags", "--cppflags"])
if find(IMagCFlag, "-I") != -1:
if len(include_dirs) == 0: # Extract include dir from latter command output and append to include_dirs
include_dirs.append([i[2:] for i in IMagCFlag.split(' ') if i.startswith("-I")][0])
IMagCFlag = replace(IMagCFlag, "\n", " ")
IMagCFlag = split(IMagCFlag, ' ')
IMagCLib = subprocess.check_output(["Magick++-config", "--ldflags", "--libs"])
IMagCLib = replace(IMagCLib, "\n", " ")
IMagCLib = split(IMagCLib, ' ')
hasIMagick = 1
else:
print "--- WARNING ---\nUnable to find Magick++-config. Are you sure you have ImageMagick and it's development files installed correctly?"

except:
traceback.print_exc()

Expand Down
1 change: 1 addition & 0 deletions src/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
###############################################################################

import xmlrpclib
import os

from optparse import OptionParser
parser = OptionParser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class Iskdaemon_admin implements EntryPoint, ValueChangeHandler<String> {
private static final String SERVER_ERROR = "An error occurred while "
+ "attempting to contact the server. Please check your network "
+ "connection and try again.";
public static final String VERSION = "0.9.3";
public static final String RELEASEDATE = "Jan 2012";
public static final String VERSION = "0.9.5";
public static final String RELEASEDATE = "Mar 2014";
protected static String WEB_ENDPOINT = "/";
public static final String XMLRPC_BACKEND = WEB_ENDPOINT + "RPC";
protected static SinkList list = new SinkList();
Expand Down