Coder Social home page Coder Social logo

Comments (8)

rcurtin avatar rcurtin commented on July 17, 2024

Hey there @pmixer, you beat us to it. :) We're working on adding simple Makefiles in #75---hopefully that will be merged very soon (like, next couple days).

For your particular case, the command you are using looks to be correct. So I'm not sure what the error is. Can you paste more output? I might be able to help diagnose the issue. πŸ‘

from examples.

pmixer avatar pmixer commented on July 17, 2024

Hey there @pmixer, you beat us to it. :) We're working on adding simple Makefiles in #75---hopefully that will be merged very soon (like, next couple days).

For your particular case, the command you are using looks to be correct. So I'm not sure what the error is. Can you paste more output? I might be able to help diagnose the issue. πŸ‘

Hi Ryan, thx for the quick reply, the error report is too long, full of boost linking failure report, β€œthe complie command looks okay” should be informative enough for fixing it, THX! I’ll try to get it fixed and update later(gdm3 just failed again after re-installed nvidia driver…)

from examples.

rcurtin avatar rcurtin commented on July 17, 2024

πŸ‘ probably the last 5 to 10 lines would be sufficient.

Have fun with the nvidia drivers. I have certainly shouted at my computer quite a lot while debugging why gdm3 doesn't come up... πŸ˜„

from examples.

pmixer avatar pmixer commented on July 17, 2024

just uninstalled the driver and switched to lightdm πŸ™ˆ

lol, yes, nvidia-drivers+gdm3 might be the best combination for improving one's computer fixing skills.

FYI, here are last few lines output:

/tmp/cc1M5oAR.o: In function `void boost::archive::basic_text_oprimitive<std::ostream>::save_impl<boost::archive::tracking_type>(boost::archive::tracking_type const&, mpl_::bool_<false>&)':
mnist_simple.cpp:(.text._ZN5boost7archive21basic_text_oprimitiveISoE9save_implINS0_13tracking_typeEEEvRKT_RN4mpl_5bool_ILb0EEE[_ZN5boost7archive21basic_text_oprimitiveISoE9save_implINS0_13tracking_typeEEEvRKT_RN4mpl_5bool_ILb0EEE]+0x77): undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
mnist_simple.cpp:(.text._ZN5boost7archive21basic_text_oprimitiveISoE9save_implINS0_13tracking_typeEEEvRKT_RN4mpl_5bool_ILb0EEE[_ZN5boost7archive21basic_text_oprimitiveISoE9save_implINS0_13tracking_typeEEEvRKT_RN4mpl_5bool_ILb0EEE]+0x95): undefined reference to `boost::archive::archive_exception::~archive_exception()'
mnist_simple.cpp:(.text._ZN5boost7archive21basic_text_oprimitiveISoE9save_implINS0_13tracking_typeEEEvRKT_RN4mpl_5bool_ILb0EEE[_ZN5boost7archive21basic_text_oprimitiveISoE9save_implINS0_13tracking_typeEEEvRKT_RN4mpl_5bool_ILb0EEE]+0xdf): undefined reference to `boost::archive::archive_exception::~archive_exception()'
/tmp/cc1M5oAR.o: In function `void boost::archive::save_access::save_primitive<boost::archive::binary_oarchive, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(boost::archive::binary_oarchive&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
mnist_simple.cpp:(.text._ZN5boost7archive11save_access14save_primitiveINS0_15binary_oarchiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_RKT0_[_ZN5boost7archive11save_access14save_primitiveINS0_15binary_oarchiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_RKT0_]+0x18): undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
mnist_simple.cpp:(.text._ZN5boost7archive11save_access14save_primitiveINS0_15binary_oarchiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_RKT0_[_ZN5boost7archive11save_access14save_primitiveINS0_15binary_oarchiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_RKT0_]+0x2f): undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/cc1M5oAR.o:(.data.rel.local.DW.ref._ZTIN5boost7archive17archive_exceptionE[DW.ref._ZTIN5boost7archive17archive_exceptionE]+0x0): undefined reference to `typeinfo for boost::archive::archive_exception'
collect2: error: ld returned 1 exit status

as my dev environment is far from clean, might be a special issue.

from examples.

rcurtin avatar rcurtin commented on July 17, 2024

Hmm, is it possible that the boost header includes you are using differ from the libboost_serialization.so you are linking from? I see -lboost_serialization in the command, which looks fine, and it looks like the compiler found the Boost headers just fine for inclusion, but I suspect maybe there are multiple versions of Boost installed on the system or something? I'm not 100% sure, but maybe it's an avenue to look at at least.

(I also switched to lightdm at some point; fewer problems...)

from examples.

pmixer avatar pmixer commented on July 17, 2024

maybe, I'll try to get a clean environment for testing. I guessed it's multi version of boost problem but it still happens after uninstalled cisco anyconnect(the only one using it's own libboost*) 😿 .

BTW, I'm always surrounded by these kinds of wried issues, will report back later once fixed.

(yes, lightdm much better, BTW, pls do not use newest nvidia driver if it's not necessary, try 418.88 instead... just fixed the issue by installing another version 🀦 )

from examples.

pmixer avatar pmixer commented on July 17, 2024

Update, I modified the Makefile based on #75 as:

# This is a simple Makefile used to build the example source code.
# This example might requires some modifications in order to work correctly on
# your system.
# If you're not using the Armadillo wrapper, replace `armadillo` with linker commands
# for the BLAS and LAPACK libraries that you are using.

TARGET := mnist_simple
SRC := mnist_simple.cpp
LIBS_NAME := armadillo mlpack boost_serialization

CXX := g++
CXXFLAGS += -std=c++11 -Wall -Wextra -O3 -DNDEBUG -fopenmp
# Use these CXXFLAGS instead if you want to compile with debugging symbols and without optimizations.
# CXXFLAGS += -std=c++11 -Wall -Wextra -g -O0

LDFLAGS  := -fopenmp
LDFLAGS += -L/home/pmixer/Downloads/gsoc/mlpack/build/lib
INCLFLAGS := -I/home/pmixer/Downloads/gsoc/ensmallen/include
INCLFLAGS += -I/home/pmixer/Downloads/gsoc/mlpack/build/include
CXXFLAGS += $(INCLFLAGS)

OBJS := $(SRC:.cpp=.o)
LIBS := $(addprefix -l,$(LIBS_NAME))
CLEAN_LIST := $(TARGET) $(OBJS)

# default rule
default: all

$(TARGET): $(OBJS)
	$(CXX) $(OBJS) -o $(TARGET) $(LDFLAGS) $(LIBS)

.PHONY: all
all: $(TARGET)

.PHONY: clean
clean:
	@echo CLEAN $(CLEAN_LIST)
	@rm -f $(CLEAN_LIST)

it works...

and write another CMakeLists.txt:

cmake_minimum_required(VERSION 3.10.2)
project (mnist_simple C CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Armadillo REQUIRED)
find_package(Boost REQUIRED COMPONENTS serialization)

# demostrated by https://github.com/mlpack/mlpack/issues/444
find_path(MLPACK_INCLUDE_DIR
  NAMES include
  PATHS /home/pmixer/Downloads/gsoc/mlpack/build/
)

find_path(ENSMALLEN_INCLUDE_DIR
  NAMES ensmallen.hpp
  PATHS /home/pmixer/Downloads/gsoc/ensmallen/include/
)

find_library(MLPACK_LIBRARY
  NAMES mlpack
  PATHS /home/pmixer/Downloads/gsoc/mlpack/build/lib/
)

include_directories(${Boost_INCLUDE_DIRS})
message( ${Boost_INCLUDE_DIRS} )
include_directories(${MLPACK_INCLUDE_DIR})
message(${MLPACK_INCLUDE_DIR})
include_directories("/home/pmixer/Downloads/gsoc/mlpack/build/include/")
include_directories(${ENSMALLEN_INCLUDE_DIR})
message(${ENSMALLEN_INCLUDE_DIR})

add_executable(simple mnist_simple.cpp)

target_link_libraries(simple ${MLPACK_LIBRARY})
target_link_libraries(simple "armadillo")
target_link_libraries(simple Boost::serialization)

which also work 😹, not sure what happended in linking phase if combine compiling .o file and linking together as in initial pasted compile command. Would go back to this thread latter to figure out what's wrong with it. (as compiled and executed mnist sample, would start reimplement JODIE etc. lol)

from examples.

mlpack-bot avatar mlpack-bot commented on July 17, 2024

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! πŸ‘

from examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.