{"id":19297921,"url":"https://github.com/analogdevicesinc/libsmu","last_synced_at":"2025-03-03T06:05:42.811Z","repository":{"id":19793930,"uuid":"23053387","full_name":"analogdevicesinc/libsmu","owner":"analogdevicesinc","description":"Software abstractions for the analog signal exploration tools.","archived":false,"fork":false,"pushed_at":"2024-09-03T21:18:45.000Z","size":6958,"stargazers_count":31,"open_issues_count":43,"forks_count":32,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-02-24T05:05:36.610Z","etag":null,"topics":["adalm-1000","m1k","pixelpulse2"],"latest_commit_sha":null,"homepage":"http://analogdevicesinc.github.io/libsmu/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/analogdevicesinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-18T00:07:27.000Z","updated_at":"2024-10-11T05:26:40.000Z","dependencies_parsed_at":"2023-10-20T17:04:09.172Z","dependency_job_id":"c5ffbc73-6f40-4e21-a1da-a256b225630d","html_url":"https://github.com/analogdevicesinc/libsmu","commit_stats":{"total_commits":1571,"total_committers":23,"mean_commits":68.30434782608695,"dds":0.3730108211330363,"last_synced_commit":"dbb484f004d9eb5251aa4667f5cf09b3ff5610e2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analogdevicesinc%2Flibsmu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analogdevicesinc%2Flibsmu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analogdevicesinc%2Flibsmu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analogdevicesinc%2Flibsmu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analogdevicesinc","download_url":"https://codeload.github.com/analogdevicesinc/libsmu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241616683,"owners_count":19991542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adalm-1000","m1k","pixelpulse2"],"created_at":"2024-11-09T23:06:29.251Z","updated_at":"2025-03-03T06:05:42.792Z","avatar_url":"https://github.com/analogdevicesinc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![coverity status](https://scan.coverity.com/projects/analogdevicesinc-libsmu/badge.svg)](https://scan.coverity.com/projects/analogdevicesinc-libsmu)\n\n# libsmu\n\nlibsmu contains abstractions for streaming data to and from USB-connected\nanalog interface devices, currently supporting the Analog Devices' ADALM1000.\nBuilding off of LibUSB for cross-platform operation, it offers the sourcing of\nrepeated waveforms, configuration of hardware, and measuring of signals.\n\nPython bindings are also provided in the form of the pysmu module. See\ninstructions below for how to build them.\n\n# Simple installation\n## Conda packages\nConda and Anaconda are cross-platform package-management tools that generally focus around python but can support any language or package generally.\nYou can find documentation on the libsmu conda package [here](https://wiki.analog.com/university/tools/conda?s[]=libsmu) .\n\n## Linux\nDownload the specific libsmu .deb package for your Linux distribution from the Releases section. Currently we are supporting Ubuntu 16, 18 and 20. The package name should start with libsmu and contain the OS version.\nGo to the folder you downloaded the package in and open a terminal, then run the following command:\n```shell\nanalog@analog:~$ sudo apt install -f ./\u003clibsmu_package_name\u003e.deb\n```\n\n\n## MacOS\nDownload the specific libsmu .pkg package for your MacOS distribution from the Releases section. Currently we are supporting MacOS 10.15, 11.0. The package name should start with libsmu and contain the MacOS version.\n\nOpen a terminal and run the following command which will install only the base library in /Library/Frameworks.\n```shell\nanalog@analog:~$ sudo installer -pkg /path/to/\u003clibsmu_package_name\u003e.pkg -target /\n```\n\nA different way to install libsmu on MacOS is by using the .tar.gz located in the Releases section. This will install the .dylib (libraries) into system paths (usr/local) and it will also install the smu CLI.\n```shell\ntar -xzvf \u003clibsmu_package_name\u003e.tar.gz --strip=3 -C /usr/local\n```\nBased on this base library installation, you can install the Python bindings manually for the desired Python version. Check the **Python** section below or you can use the wheel packages provided in the official installer. Check out the next section:\n\n## Python bindings for Windows, Linux and MacOS\nIf you want to install pysmu (the Python bindings for libsmu), you can download the specific wheel for your version.\nWe provide python wheel packages for the following Python versions: py3.7, py3.8, py3.9, py3.10. You can download the .whl\nfor your Python version from the official releases or use the ones provided on test.pypi.org (soon from the official pypi.org as well).\nOn Linux:\n```shell\n# If you are installing from test.pypi.org:\nanalog@analog:~$ python3 -m pip install --index-url https://test.pypi.org/simple/ pysmu\n# If you are installing the .whl downloaded from our official github release:\nanalog@analog:~$ python3 -m pip install pysmu-1.x.y-cp3x-cp3x-manylinux_2_24_x86_64.whl\n```\nOn MacOS:\n```shell\n# If you are installing from test.pypi.org:\nanalog@analog:~$ python3 -m pip install --index-url https://test.pypi.org/simple/ pysmu\n# If you are installing the .whl downloaded from our official github release:\nanalog@analog:~$ python3 -m pip install pysmu-1.x.y-cp3x-cp3x-macos_10_15_x86_64.whl\n```\nPlease note that in order to use these bindings you need the core C++ library they depend upon. This is not packaged with the pypi release but you can install the [latest release](https://github.com/analogdevicesinc/libsmu/releases/latest) or the latest **untested** binaries from the [master branch](https://ci.appveyor.com/project/analogdevicesinc/libsmu).\n\n\n# Build instructions for libsmu on Linux\n## Install Dependencies\nInstall prerequisites\n```shell\nanalog@analog:~$ sudo apt-get update\nanalog@analog:~$ sudo apt-get install libusb-1.0-0-dev libboost-all-dev cmake pkg-config\n```\nInstall to build Python bindings\n```shell\nanalog@analog:~$ sudo apt-get install python3 python3-setuptools python3-pip\nanalog@analog:~$ python3 -m pip install --upgrade pip\nanalog@analog:~$ sudo python3 -m pip install cython setuptools build wheel\n```\nInstall to build documentation\n```shell\nanalog@analog:~$ sudo apt-get install doxygen\n```\n\n# Build instructions for libsmu on MacOS\n## Install Dependencies\nInstall prerequisites\n```shell\nanalog@analog:~$ brew update\nanalog@analog:~$ brew install libusb cmake pkg-config boost\n(optional) analog@analog:~$ brew link --overwrite boost\n```\nInstall to build Python bindings\n```shell\nanalog@analog:~$ brew install python3\nanalog@analog:~$ python3 -m pip install --upgrade pip\nanalog@analog:~$ python3 -m pip install cython setuptools build wheel\n```\nSetup tools and pip should be included in the \"python3\" package.\n\nInstall to build documentation\n```shell\nanalog@analog:~$ brew install doxygen\n```\n\n# Clone, configure and build\n```shell\nanalog@analog:~$ git clone https://github.com/analogdevicesinc/libsmu.git\nanalog@analog:~$ cd libsmu \n```\nOptions:\nCMake Options       | Default | Description                                    |\n------------------- | ------- | ---------------------------------------------- |\n`BUILD_CLI`   | ON | Build command line smu application                                |\n`BUILD_PYTHON`   | ON | Build python bindings                            |\n`WITH_DOC`          | OFF | Generate documentation with Doxygen and Sphinx     |\n`BUILD_EXAMPLES`        |  OFF | Build examples                            |\n`INSTALL_UDEV_RULES` |  ON | Install a udev rule for detection of USB devices   |\n\nConfigure via cmake:\n```shell\nanalog@analog:~$ mkdir build \u0026\u0026 cd build\nanalog@analog:~$ cmake .. -DBUILD_PYTHON=ON\n```\n\nCompile:\n```shell\nanalog@analog:~$ make\n```\n\n# Install\nIf **-DBUILD_PYTHON=ON** (from the above options) is specified, this step will also install the Python Bindings using the Python version detected at the CMake configuration step.\n```shell\nanalog@analog:~$ sudo make install\n```\n\n# Docs\n\nDoxygen-based documentation is available at\nhttps://analogdevicesinc.github.io/libsmu/.\n\nThis can also be built locally if enabled using the CMake option mentioned above.\nAfter make is run, the generated documentation files can then be found in the\nhtml subdir of the build directory.\n\n# Testing\n\nThe [Google Test framework](https://github.com/google/googletest) is used to\nrun various streaming tests. Make sure it's installed on the host system and then use the\nfollowing to build and run tests:\n\n```shell\nanalog@analog:~$ cmake -DBUILD_TESTS=ON ..\nanalog@analog:~$ make check\n```\n\nNote that at least one device should be inserted to the system for the checks\nto run properly.\n\n# Python\n\nPython Bindings are enabled by default and can be disabled using the CMake option mentioned above.\n\nNote that this will build only one version of Python for the first supported\nimplementation it finds installed on the system. To build them for other\nversions it's easiest to build them manually via the setup.py script in the\nregular python manner if libsmu has already been built and/or installed on the\nhost machine.\n\n```shell\nanalog@analog:~$ git clone https://github.com/analogdevicesinc/libsmu.git\nanalog@analog:~$ cd libsmu/build\nanalog@analog:~$ cmake -DBUILD_PYTHON=ON .. #this will generate a setup.py file in the current directory\nanalog@analog:~$ python3 -m build #this will create .whl files in a dist/ directory\n# the .whl files can then be installed using \"pip install\"\n```\n\n# Linux FAQ\n\nBy default, libsmu is installed into various directories inside /usr/local which\nimplies that the runtime linker cache often needs to be regenerated,\n otherwise runtime linking errors will occur.\n\nRegenerate runtime linker cache after install:\n```shell\nanalog@analog:~$ sudo ldconfig\n```\n\nIf the same errors still happen, make sure the directory the libsmu library is\ninstalled to is in the sourced files for /etc/ld.so.conf before running\nldconfig.\n\nIn addition, the udev rules file (53-adi-m1k-usb.rules) is installed by default\nto give regular users access to devices supported by libsmu. Udev has to be\nforced to reload its rules files in order to use the new file without rebooting\nthe system.\n\nReload udev rules files:\n```shell\nanalog@analog:~$ sudo udevadm control --reload-rules\n```\n\nFinally, for python support on Debian/Ubuntu derived distros users will have to\nexport PYTHONPATH or perform a similar method since hand-built modules are\ninstalled to the site-packages directory (which isn't in the standard search\nlist) while distro provided modules are placed in dist-packages.\n\nAdd pysmu module directory to python search path:\n```\n$ export PYTHONPATH=/usr/local/lib/python3.7/site-packages:${PYTHONPATH}\n```\n\nNote the command will have to be altered for targets with different bitness or\npython versions.\n\n\n# Windows\n\nOn Windows, it's easiest to use the provided installers,\n[libsmu-setup-x86.exe](https://github.com/analogdevicesinc/libsmu/releases/latest) and\n[libsmu-setup-x64.exe](https://github.com/analogdevicesinc/libsmu/releases/latest)\nthat install either 32 or 64 bit support, respectively. During the\ninstall process options are provided to install drivers and Visual Studio\ndevelopment support.\n\nNote that after v1.0.3, libsmu Windows installers no longer provide the option to install\nPython bindings. The process for installing pysmu on Windows is similar to the one described above for \nMacOS and Linux.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalogdevicesinc%2Flibsmu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalogdevicesinc%2Flibsmu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalogdevicesinc%2Flibsmu/lists"}